Added some connection error handling

This also disconnects the textarea in case of errors, so if the user opens ST, the event handlers won't pile up.