Better OS check

Use RbConfig::CONFIG['host_os'] to check for platform because RUBY_PLATFORM returns "java" for JRuby on Mac OS X.