Cookies, disconnect button and wsgate crash fix

- Cookies are set only when proxy is used for generic access
- Disconnect button is not shown anymore when integrated with openstack
- fixed wsgate crash (race condition - memory was cleared before waiting for the actual disconnect / thread to finish).