Add :chdir option support to spawn

Move processExecOptions() to RubyIO.java, since it already has
check*Options() already.

Do note that we restore working directory after `spawn`.