When the Remote Shell bundle is stopped, the listener thread is stopped, but any threads currently handling remote shell connections are
not stopped. If such connections receive commands, they cause NullPointerExceptions (since the service is not available any more due to
the bundle stop) and the remote end seems to hang.
The right handling would be to terminate any remote handling threads and to close the respective connections.
This would also clean up the threads and allow for proper garbage collection in case of bundle uninstallation or upgrade.