Use TCP Keepalive option

This helps to avoid cases where clients do not notice that the socket
got lost and users have to manually reconnect to get back into a working state

Note: I could not test this much yet beyond verifying that the setsockopt worked.