Fix Hash#select and #reject on ruby 2.1.1

Backport commit https://github.com/rails/rails/commit/5402b72faafecfa1eda8afce0e0f194fcf385fe3 to fix #14188

After `git bisect` turns out this commit fix ruby 2.1.1.

review @carlosantoniodasilva @tenderlove