The SignalWait w will sleep forever if the there is an error and the D-bus signal com.jolla.jollastore.storeCredentials is not received by ssu for any reason, right?

Maybe add a timeout and check that the signal com.jolla.jollastore.storeCredentials was queued successfully in ssu.cpp line 601. In case of timeout or D-bus error use Ssu::setError(...) to clear the SignalWait and log an error msg.