viewport: Do not attempt to refresh an empty viewport.
This fixes a "race" condition where setting the model also causes the viewport to be resized. This happens, for example, with a QQC2.PageStack