Fix friendlist order on refresh.

The friendlist order got disturbed on every sync.
I modified the code so it will now download and store it into the database and then receive it from the database.