Optimizations on leader election.
Merge pull request #86 from EasonLiao/optimize_election

Optimizations on leader election.
NettyTransport: check if the sender is null in handshakeFailed.

The sender might have already been removed by the clear() method
when the handshakeFailed() is invoked. Check if the sender is null
before calling shutdown() on it.
Merge pull request #87 from m1ch1/master

NettyTransport: check if the sender is null in handshakeFailed.