QMngHandler: Prevent division by zero.

Task-number: QTBUG-42321
Change-Id: I1d0762782e71fb13f96d0f42c4661b708e02051d
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
QMngHandler: Avoid endless loop

In case the animation only has one frame, like Waves1.mng in the bug
report.

Task-number: QTBUG-42321
Change-Id: Id6616f4f51c1b6f06f7e4677cbd9e56135d2a52b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Merge remote-tracking branch 'origin/5.4' into dev

Change-Id: Id484a6b43e3ee15e06e8291ae69f717b855a2fe5