Fix NPEs when display is added or removed

- In WindowContainer set parent of the child after it is actually
  added. This way if the child class depends on this in overridden
  methods it will be in correct state.
- Reconfigure display only if it is attached. Otherwise there is no
  corresponding DisplayContent record with configuration.

Change-Id: I20c51522d82f9d0ca98f098070585e6472a23e98
Test: Updated WindowContainerTests.
4 files changed