More robust connection failure handeling

Added better connection failure handling code. Fixed the state bug for
binary light on/off eventghost actions.