cpu-exec: fix exception_index handling