Fix off by one error in JSON extract path code.

Bug report by David Wheeler, diagnosis assistance from Tom Lane.