Fix a potential deadlock in ProcessStatsService.

The potential deadlock:
ThreadA (backtrace),
  at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java)
  at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java)
  at com.android.server.am.ProcessStatsService.performWriteState(ProcessStatsService.java)
     --- try to lock mWriteLock.
  at com.android.server.am.ProcessStatsService.writeStateLocked(ProcessStatsService.java)
  at com.android.server.am.ProcessStatsService.writeStateLocked(ProcessStatsService.java)
  at com.android.server.am.ProcessStatsService.writeStateSyncLocked(ProcessStatsService.java)
  at com.android.server.am.ProcessStatsService.shutdownLocked(ProcessStatsService.java)
  at com.android.server.am.ActivityManagerService.shutdown(ActivityManagerService.java)
     --- lock AMS

ThreadB (backtrace),
  at com.android.server.am.ProcessStatsService.getStatsOverTime(ProcessStatsService.java),
     --- lock mWriteLock and then try to lock AMS.
  at com.android.server.am.ProcessStatsService.dumpAggregatedStats(ProcessStatsService.java)
  at com.android.server.am.ProcessStatsService.dumpInner(ProcessStatsService.java)
  at com.android.server.am.ProcessStatsService.dump(ProcessStatsService.java)

Change-Id: I437a5cedceb34292a6bd1d9e7610f52b1478e424
Signed-off-by: hanpengx <pengfeix.han@intel.com>
Out of memory using wallpaperPicker switching wallpapers

Out of memory issues arise when switching wallpapers using
WallpaperPicker quickly, due to not releasing large Bitmaps
before allocating space for new ones.

Resolved by securing that wallpaper bitmaps are set to null
in order to be garbage collected when switching wallpaper.

Added stability correction making sure noone can retrieve
bitmap once it has been recycled by first calling
WallpaperManager.forgetLoadedWallpaper().

Change-Id: I318ee46d8613bec15dd52dd7b61ae950e760e6f6