Fix warning about unsupported encoding in 1.8.7
Untaint spec_cache_dir for $SAFE=1
On ruby 1.8.7 a Tempfile can be unlinked only once