Fix assert after makerope boundary check

The browser demo asserts on qt-project.org after the makerope security
fix.

Port of http://trac.webkit.org/changeset/169397

Change-Id: I19c98737735d9b17133742752928d4ce6349de13
Reviewed-by: Michael Bruning <michael.bruning@digia.com>