Fix bug of NioSession.close and bug of keep alive.