Cleans up behind and releases the lock file.
ErrnoException if any of the system calls fails
See Implementation
Cleans up behind and releases the lock file.