Window: Avoid height flickering when resizing dialogs

When you have a dialog open and resize the browser window, the dialog
will appear to close and re-open (even if its size has not actually
changed). This is because CSS transitions suck.

* Factor out a Window#withoutSizeTransitions helper function from
  Window#getContentHeight, which disables resize transitions on the
  given window, runs some code and enables the transitions back.

* Correct the code in Window#setDimensions which aimed to calculate
  the necessary window height after setting its width, but failed to
  do so because it didn't account for the transition on the width.

Bug: T76371
Change-Id: I410f42949b81f439ab712a263498ba6012de2e23