Fix ruby engine detection such that it detects Ruby 1.8.7

Based on bundler's ruby engine detection:

https://github.com/carlhuda/bundler/blob/438ef20987951883cb5837d245eac9c517848b2d/lib/bundler/ruby_version.rb

Fixes https://github.com/headius/thread_safe/issues/5