Avoid undefined behaviour with large array indices

jq programs which access numeric indices or ranges which fall outside the allowed bounds of int would execute undefined behaviour. This adds bounds checking to prevent this from happening. It also fixes the FIXME for not doing lookups for non-integer numeric indices.