Copied mutex_m.rb from MRI.
Implemented Symbol#=~ for Ruby 1.9.
Implemented Object#public_send for Rails 4.0.