better session exit handling for JMX gateway and client
adapt to needs for dawn runWorkbench script