Fixes#138
If the connection to a broker is lost mid qos 2 flow, there is a window where we have processed the PUBREL, released the message and deleted it from our store, but not sent the PUBCOMP. When the connection is re-established, and the PUBREL is resent by the broker, we assume the message still exists - and hit the error reported.
The fix is to check the message is valid before trying to process it. We send the PUBCOMP to complete the flow regardless.
Fixes#130
There was a timing window where a client could connect to a broker just as new flows were deployed that would cause the on-connect callback to be called after client has been set to null. This caused an NPE.
The fix is to check client isn't null in the event handler.
Alternative implementation, closes#42
The username/password as not stored in the main flow file for security reasons;
they are stored in the adjacent credentials file. This does mean an extra step
to importing an MQTT node, as the user has to manually edit it to re-add username
and password if needed.