Fixed Dropbox/Google storage async save call

When clicking "Grant access", the settings for Dropbox/Google were saved
through a call that gets cancelled when redirecting to the grant page
(for example in Firefox)

This fix makes sure the "save settings" call finished before redirecting
to the grant page.

Fixes #6176

Please review @karlitschek @schiesbn @icewind1991 
Please test this branch @ser72