js2-re-search-forward-inner: Handle the case when string ends right after match

Follow-up to #123