Add support for CheckLatency and MaxLatency

Read CheckLatency and MaxLatency from config.
Add a try/catch around the call to RemoteEndPoint

Calling RemoteEndPoint on a closed socket throws an exception on
mono/linux, but not on .NET.  The exception prevents the session from
being properly closed even though the socket is disconnected.
Added CHECK_LATENCY constant