Updated for support mac

Use "unknownhost" as hostname if RUBY_PLATFORM was unknown.
Use ENV["TMPDIR"] or ENV["TEMP"] as tmp_dir if RUBY_PLATFORM was unknown.