Fixed issue when socket was closed by server while connecting

If the socket connection is closed by the server while connecting
(meaning the connection establishment effectively failed but without an
error), the user wasnot be notified because the status is "Connecting"
and OnClosed will not fire the event in that case which gives the user
no chance to react to this event.
In this case the status must be changed to "Closing" (similar to
client_Error) to trigger the event.