fix a panic if index out of range

go-jsonpatch panics if pointer's index is outing of range.
So, I fixed this probrem with range checking,  and changed to return error.

thank you.