use flock, not -e, to perform locking

Before this code was released, when it was internal work code, we
used flock.  This was changed in 2009, with a commit message reading
"use O_EXCL instead of flock" and with no further explanation.  I'd
like to think that there was a concrete reason for this, but I don't
know what it was.  flock on Solaris, where it was run, is a bit
weird, but no so weird that we should have had to abandon using it.

I will switch us to using flock, and see whether I can see a problem
come back.

Other changes: the created file is no longer deleted.  Otherwise,
there would be a race condition: process 1 might finish with a job,
then unlink the file just after process 2 opened it, but before it
flocked.  I hoped I could bring back lockfile deletion by replacing
the flock call with O_EXLOCK and checking for EWOULDBLOCK as the
only error code that failure to lock would report.  Unfortunately,
Solaris does not support O_EXLOCK, to the best of my knowledge.

Much of this patch was written by Mark Jason Dominus and then
tweaked by me.  Unlike the patches he supplied, locks are always
requested with LOCK_NB, emulating the previous "run or fail
immediately" behavior.  Unless someone really needs their jobs to
wait to lock, I'd like to keep things simple.