Add Theme.setNewResourcesImpl() method.

- Race condition between Theme.setImpl() cnd Theme.applyStyle() can
  happen when creating Window and Configuration-change occur together.
- To maintain the integrity, the whole process of creating new ThemeImpl
  and setting it in Resources.setImpl() should be guarded by the lock.
- Moves the lock of ThemeImpl.mKey to Theme.mLock.

Bug: 173558667
Test: manual test in the bug
Change-Id: I9ebdc48333b188c0b26b1b7490a5cbb34bbe6e0f
2 files changed