Handle null bytes in strings

Starting from 2.2.0, dumping strings that contain null bytes have
failed. This is caused by the change to use `rb_string_value_cstr`
instead of `StringValuePtr`. Changing this to use `rb_string_value_ptr`
fixes the issue issue as `rb_string_value_ptr` only returns the pointer
to the buffer without scanning the string for nulls.