objspace_dump.c: refine output

* ext/objspace/objspace_dump.c (dump_output): allow IO object as
  output, and use Tempfile.create and return open file instead of
  mkstemp() and path name for :file output.
  [ruby-core:58266] [Bug #9102]
* test/objspace/test_objspace.rb (TestObjSpace#dump_my_heap_please):
  remove temporary output file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e