Properly rescue Timeout::Error.

The `rescue` modifier does not take an exception class to rescue.
The MQTT::Client#connect automatically calls #disconnect when a block is given.
MqttAgent: Ignore a retained message previously received.

This should fix the problem where MqttAgent creates an event from the
same last message every time it runs if it is retained by the server.
Upgrade mqtt to 0.3.1 which supports MQTT protocol version 3.1.1.
Merge pull request #579 from knu/mqtt_agent-dedup

MqttAgent: Ignore a retained message previously received.