semaphore files valid only when zero-length

This prevents files having content from inadvertently being deleted
due to misuse of the --lockfile or --unlockfile flags.