add missing SIGKILL to check_lock

and factor out a common kill_pid routine.