Bug 854289 - Fix offsetting of viewport with dynamic toolbar. r=kats

Make sure to offset the viewport *after* setting the Gecko viewport on
setFirstPaintViewport callbacks, so that we don't store an incorrect viewport
origin and end up offsetting events incorrectly.

Similarly, on page size updates, the Java-side viewport metrics are used to
update the Gecko metrics, so make sure they're clamped so that they aren't
incorrect during overscroll.