Fixed empty language list in preferences

The DB was not open while requesting the list