Fix a number of multi-user bugs.

original commit: https://github.com/CyanogenMod/android_frameworks_base/commit/07bd77415e60cf74da6321fba7a61a2b426b295a