fixed order of GID & UID switching and logging start

https://jira.skype.net/browse/QMS-1731