Use portable locks that are NFS-friendly

This is actually an annoying error on my part. I knew that one of them
doesn't work over NFS, but I was confused which one it was. It's "flock"
that doesn't work anywhere other than local disk, while "lockf" is a
wrapper around fcntl and should work over NFS. I feel shamed.