Layout the config-changed window if it has surface

This patch fixes an issue which caused the resumed app to get the
wrong frame at first.

https://code.google.com/p/android/issues/detail?id=82242

Change-Id: I4483029326afca143e7921f3b9563da4f566d2e5
Merge "Layout the config-changed window if it has surface"