Fallback earlier if D-Bus is not available

If D-Bus is not available, at the moment qtkeychain jobs do not return. I added the detection if D-Bus is running and moved the fallback code into an extra function to avoid code duplication as this code is now called from two locations.