Xterm: handle close and error events of the underlying websocket
Xterm: handle close and error events of the underlying websocket

Detach the terminal and drop the term object. This way the terminal
will get recreated at the next appear event and therefore the frontend
doesn't need to be reloaded when the backend gets restarted.

mmind/boardfarm-mgmt,mmind/boardfarm-mgmt,mmind/boardfarm-mgmt,mmind/boardfarm-mgmt