Check for state change before emitting connect/disconnect events

This avoids repeated disconnect events being fired by the connection
when attempting to reconnect every second.
simpler connection state
set connection state before emitting an event
Merge pull request #93 from leapmotion/connection-state

Connection state