Sorry, there's something I should have noticed during the first review.  flock() returns early when it's interrupted by a signal.  All calls to flock() should have a guard that looks something like this:
```c
int err;

do
  err = flock(osf, LOCK_SH);
while (err == -1 && errno == EINTR);

if (err) {
  // print an error message and exit
}
```

Also, I just noticed that we don't release the lock on errors... that's something we'll need to address.