Fix off-by-one error, and add test of faulting in JIT code.

It's pretty unlikely we'd ever hit this off by one bug, but good to fix anyway.

Unfortunately this test doesn't reproduce #692, but we can iterate on it.