locks: eliminate BUG() call when there's an unexpected lock on file close