Add Ruby 3.0.2 patches to fix method override bug
These patches are necessary to fix https://bugs.ruby-lang.org/issues/17725, for which there exist only unreleased patches.
This is currently breaking our Ruby 3 build, so until 3.0.3 is out let's apply these independently.
Edited by Matthias Käppler