Deals with the onStop() method, cancels the running sockets.