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

Backport of e13be94 to stable6