add BigDecimal segfault fix from ruby revision 45015

  https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/45015
  https://gist.github.com/henrik/10880288
  https://bugs.ruby-lang.org/issues/9657#note-8