Fix a possible crash in StyleSheetStyle

Task-number: QTBUG-35901
Change-Id: I72e82a166d30cf5e4dac2917c633c7cbd355c817
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>