scanner_get_token: robustness improvement

Patch to make scanner_get_token more robust (avoid over-reading).
(cherry picked from commit a3c540bc9ba74560239e2a906db4846fcdbec90e)
Enforce RFC 2616 and accept "0" after a backslash for quoted-strings.

Reported by Peng <howtofly(at)gmail.com>
(cherry picked from commit c70f5ce323502e04f19e4c126c3235a14a1ce359)