Added session_keepalive setting

When session_keepalive is true (default) the heartbeat will be send as
often as the half of the session timeout value.

Backport of 912da8d to stable6