Fix buffer overflow in stackprof_record_sample()

Fixes an overflow where `rb_profile_frames` was being passed an incorrect value for the `limit` parameter.