implement fgrun using a pty, fixes #20