pkg/lock: cleanups, blocking vs. nonblocking calls, FD extraction