checks that a pid is provided before attempting kill