Fix issues reported by Reynold
If key is not valid, close connection
Be more aggressive and defensive in select also
Change indentation
Be more aggressive and defensive in all uses of SelectionKey in select loop
Spurious commit, reverting gitignore change
Add addition catch block for exception too
Merge pull request #586 from mridulm/master

Pull request to address issues Reynold Xin reported