This code in conn_log.c appears to have an error:
if (conn->hot_backup_start == 0 && conn->log_cursors == 0) { WT_WITH_HOTBACKUP_READ_LOCK(session, WT_ERR_ERROR_OK( __wt_ftruncate(session, close_fh, close_end_lsn.l.offset), ENOTSUP, false), NULL); }
It's a problem to take an "early exit" (goto or return) out of a WT_WITH... macro, lest some resource be held. In this case, the hotbackup read lock will be held if __wt_ftruncate fails. We normally need to assign ret inside the WT_WITH... and check it outside the macro.
See attached patch file - it contains a dist script to detect these sorts of errors.