Fix keepalive handling in MQTT client
Fixes #124