Include PID inside lock files.

Write the process ID in the lock file so that we can use lock files as
a means to inspect whether or not a given process is running.