Fix keepalive

Keepalive was not being set quite right.
Use socket.SOL_SOCKET instead of socket.IPPROTO_TCP to set the keepalive option.