libmosquitto shouldn't cancel threads it didn't create. This change allows us to keep track of whether threads were created by the library or by external code. Thanks to Josip Ćavar. Bug: https://github.com/eclipse/mosquitto/issues/166
Fix incorrect loop timeout being chosen when using the threaded interface and keepalive = 0. Thanks to Gianfranco Costamagna. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=471334