Make sure acquireLocks() / releaseLocks() are balanced

 * Move some logic from task => service
 * Clean up checks
 * Move folder state into BackupImapStore