Fixed a crash bug on S60 SDK 3.1.
Fixed a crash bug on S60 SDK 3.1.

The crash was caused by the image data not being locked before being
accessed.

Also avoided an unnecessary detach copy by making the image variable
a reference.

RevBy:    Jani Hautakangas
Task:     QTBUG-4705
AutoTest: QWidget passed
(cherry picked from commit 330dc1e5895a8950615a9bbf26154f5387b023b1)

radekp/qt,igor-sfdc/qt-wk,radekp/qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,radekp/qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,radekp/qt,igor-sfdc/qt-wk,radekp/qt,radekp/qt,radekp/qt,radekp/qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,radekp/qt,pruiz/wkhtmltopdf-qt,radekp/qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt