Fix unused variable warning in release builds

Part of trying to get https://codereview.qt-project.org/#change,70160 in

Change-Id: Ie11e50c258343c590d6b240cf8ae7ce070510f6f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>