Test for pid before trying to kill