Added support to writeback tty and command info to a file.
This is used by gxf to start binexpect instances on the fly from gdb.