ensure erl_port pid is a Pid before killing it