Replace usage of RARRAY_PTR with rb_ary_entry

This prevents having to setup an RArray structure in the C-API. Also
replace RARRAY() usage with rb_ary_entry or RARRAY_LEN.
Fix another realloc warning message