Fix issue with warnings generated for #duplicates on Ruby 2.1

Ruby 2.1 complains when reject is called on a Hash with a
default value.  Switching to select doesn't complain.
See also https://bugs.ruby-lang.org/issues/9275