Revert "Revert "Fixed some crash-on-theme-removal scenarios""

This reverts commit a9b8ad1e97db2210292c6c10854f5eab48eb2cc8.
Revert "ThemeManager: Needs to use android.uid.system"

This reverts commit a86a1906bfae15832359aab7a0d8199bc0ff5987.