Inline code from `Json_spew_json`.

Change logic to attempt deletion of the PID lockfile regardless of the outcome of writing to the lockfile.

This fixes LUCY-265.