nmdb: Only unlink the pidfile if we were asked to write it