connection activity fixes

This pull request corrects the behavior the connection activity monitoring code. Specifically, the code now:

* detect idle connections that are still in the handshaking process; and
* records receiving any message on a connection as activity.

No interfaces are changed by this commit.