inprocess: improve io.input() and io.output() emulation.

* lib/specl/inprocess.lua (env.io.input, env.io.output): Always
return the latest file object, like the core Lua implementations.
(env.io.output): Flush any output from the previous output file
before switching to a new file.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>