Fix the object allocation profile mode on Ruby 2.x

The object allocation profiler currently works by patching the
rb_newobj function in Ruby. This function is no longer directly used
in Ruby 2.x - rb_newobj_of is used instead.

This change patches either rb_newobj or rb_newobj_of, depending on
whether the targeted Ruby version has rb_newobj_of available.