Prevent crash on unregistration
Previously it was possible that the registration thread was still
running when the user clicks the "Unregister" button.
To prevent that, we now wait for the previous subscription thread to
finish before starting the next registration/unregistration thread.
Resolves: rhbz#1845962