script: Also flush writes to timing file.

If both -f and -t are given, flush the timing fd on each write, similar
to the behavior on the script fd. This allows playback of still-running
sessions, and reduces the risk of ending up with empty timing files when
script(1) exits abnormally.

Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com>
script: clean up files usage

 * don't initialize timingfd (to stderr) when -t not specified

 * care about timingfd dooutput() rather in main()

 * make timingdf gloval like fscript FILE

 * close all in done()

 * close irrelevant things in subshell and input processes

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>