Output STDIN to a file after every N seconds of no output.