port to new soledad async api

**Not ready to merge, missing changes in leap.mail and maybe other to be compatible with the new API**

It needs to synchronize the merge with the soledad async API and the upgrades in leap.mail.
The idea behind using this is to always return a deferred that will be fired, so the user of this method can attach callbacks to it. There is some code paths where no deferred will be produced, in this case we return this deferred.

In my tests this works fine, AFAIK if you fire a deferred without callbacks and afterwards you add a callback this callback will be fired as soon as you add it.