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.
chiiph diria que deveriamos tener `d = None` en el inicio de esta funcion para garantizar que `d` existe en este escopo.