Check for socket before attempting to close - related to bug at ekulyk/P...

...ythonPusherClient#14