Fixed pluck to be working with selects.

See #9777 for details.

Previously pluck is not returning what we wanted to
Added a test also to make sure it's working fine.
 
This will also fix the build for 1.8.7 as we 
were doing some sort on hash.

Thanks @pixeltrix for helping me out.

Thanks @linduxed for pairing with me.