Container: add checks for null in getWidth/Height functions

Don't throw NPE when there is no widget in Container, assume 0 size instead.