Update frame metrics / viewport when orientation changes

Rebased functional changed from
https://github.com/tmeshkova/mozilla-central/pull/48

Namely commit: https://github.com/rainemak/mozilla-central/commit/08794bf7831f94a47c6b859a634feec0c844e64d

In addition, some apzc logs ported (in another commit).