Add a connect callback handler.
Move the mqtt_subscribe calls to the connect callback handler, so they are restored after a reconnect.
This is to address #604 (closed).
It fixed the problem for me, but I'm not sure if further changes will be needed. Specifically there are calls to mqtt_pub_noval
that used to be called once, and will now be called every reconnect, and since I'm not sure what they're for I'm also not sure whether that may cause a problem.