clean up PID file more consistently