fix keepalives on client, fix a bunch of issues with closing/reopening connections on server