Core: Avoid passing uninitialised data down the hotplug pipe.

Due to alignment requirements, libusb_hotplug_message might have
some padding bytes.

This change makes sure that these padding bytes are
initialised. Valgrind no longer complains about passing uninitialised
data to the write system call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
core: Always warn when there are leaked device refs on exit

This check should done with hotplug capable backends too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Core: Make writing of log lines a single fprintf call.

Prior to this change a single line of logging performing several fprintf.

This change gets all the data for a line to be logged in a single
fprintf call. This reduced the chances of writes from another thread
getting intermixed with a log line.

It also makes it easier to change where logs are output to in the future.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>