qstring: Fix qstring_from_substr() not to provoke int overflow