Doing anything with the fd seems to cause losing the lock.