Set current branch station after checking MAIN_COMPANY

This can happen if the user created the database from one computer, didn't
register the first branch (so MAIN_COMPANY parameter is still None) and tried
to access the same database from another station that wasn't registered yet.

By calling 'set_current_branch_station' after checking the MAIN_COMPANY
parameter we can avoid that.

Change-Id: Ibd0ec5aaa972e4ac24411de50b45de77db3ded3e
(cherry picked from commit 57d6406d20056672f02f3a0da27a5b602fddbee0)
Get cookie data as unicode

The migration of the old cookie if it wasn't in md5 format was not converting
the values of the cookie to unicode, producing an error when when calling
LoginUser.hash.

Instead, always return the cookie data as unicode as it will be used that way.

Change-Id: I60437443432cec3a59d0eca75eb76c5f7592be30
(cherry picked from commit dc75e92075d5ac91deae38ad991f797e8d9ccbba)