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 http://globaldev.co.uk/2014/05/ruby-2-1-in-detail/#hashreject