backport r46942 from ruby/ruby trunk.
backport r46943 from ruby/ruby trunk.
backport r46945 from ruby/ruby trunk.
backport r46946 from ruby/ruby trunk.
backport r46947 from ruby/ruby trunk.
backport r46948 from ruby/ruby trunk.
Support :platform key in gem.deps.rb API

Bundler spec work revealed the :platform key is not handled.
Inspection of bundler indicates that it is combined with the :platforms
key.