1. The initial user was set to USER_NULL but some clients were registering
before the user change callback happens. Since the initial user is
the owner the current user id defaults to USER_OWNER.
2. The check for global clients and window connections was using the
calling UID but there are processes that run in a per user basis
as system UID (Setting for example). Now the check is stronger
and comparing the caller PID with that of the system process.
3. The code for finding the focused window id was not checking the
global window token list in addition to that of the current user.
4. The code updating the active window id was calling out into the
window manager with a lock held.
bug:7224670
Change-Id: I9f4b7ea67eb5598b30ee7d1b68a1d3ce0cf8cfb4