fix sync issues between channelJoined and serverConnected events.  If those events are fired then the helper functions serverIsConnected and channelIsJoined should return the proper state.
fix channelParted to not fire until after channel status is reset
Merge pull request #410 from yyyc514/event_state_sync

fix sync issues between channelJoined and serverConnected events.