Make sure shader rewriter stops immediately on an empty string.

The 'invalid' token didn't really serve a purpose. If a string contains
0 for any reason, it one has reached the end.

Task-number: QTBUG-39505
Change-Id: I3fc9b8f28dc223386a72bbfa28f70fcca0fde223
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>