Fixed issue disconnecting sockets

Fixed issue where, if the socket input stream or output stream
encountered an error, the AppRTC client wouldn't properly close
the socket upon exiting.