Ensure lastPixel.y is also initalized to -1 when necessary

Task-number: QTBUG-31579

Change-Id: Ia4916ac0d384ea523bbfad0dafbc90044da7ec3e
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
(cherry picked from qtbase/f0b950144dde85b65df0c3cf83f7c8df0e94bbbf)