Function to kill process listening to a port