Fix stray close of locking file descriptor