fix account selection on fresh install

Fix bug where, at first user creation, Ring was crashing at the end of
the wizard just before displaying the main user interface. This was
caused by a preference string set to nil on first start.

Now, when to string is nil, we select the first account of the list as
this should happen only at first account creation (thus returning the
right one).

Change-Id: Id3a2c4153d920611a3cc0cbd694f8d96d772330a
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
diff --git a/src/AccountSelectionManager.mm b/src/AccountSelectionManager.mm
index 044cdff..a7cccfc 100644
--- a/src/AccountSelectionManager.mm
+++ b/src/AccountSelectionManager.mm
@@ -50,7 +50,13 @@
 
 - (const lrc::api::account::Info&) savedAccount
 {
-    return accMdl_->getAccountInfo(std::string([[self getSavedAccountId] UTF8String]));
+    NSString* savedAccountId = [self getSavedAccountId];
+    if (savedAccountId == nil) {
+        auto accId = accMdl_->getAccountList().front();
+        [self saveAccountWithId:@(accId.c_str())];
+        return accMdl_->getAccountInfo(accId);
+    } else
+        return accMdl_->getAccountInfo(std::string([savedAccountId UTF8String]));
 }
 
 - (void) setSavedAccount:(const lrc::api::account::Info&) acc