stbt record: Delete iterator to make exceptions visible
stbt record: Delete iterator to make exceptions visible

If `stbt record` is used with `--control-recorder=stbt-control`, and an
exception is raised from inside the loop of `stbt-record.record` before
`remote_input` iterator stops, the stack trace is printed before the
the iterator is being deleted. Deleting the iterator implies deleting
`term` object in `stbt-control.main_loop`, which calls the finally
block of `stbt-control.terminal` that clears the screen, therefore the
exception message is wiped out.

If `stbt record` decreases the reference counter of `remote_input` to
zero, the iterator is deleted and the terminal window is reset to its
initial state during clean-up before the exception message is printed.

wmanley/stb-tester,martynjarvis/stb-tester,martynjarvis/stb-tester,LewisHaley/stb-tester,martynjarvis/stb-tester,LewisHaley/stb-tester,stb-tester/stb-tester,wmanley/stb-tester,stb-tester/stb-tester,stb-tester/stb-tester,martynjarvis/stb-tester,wmanley/stb-tester,martynjarvis/stb-tester,stb-tester/stb-tester,martynjarvis/stb-tester,martynjarvis/stb-tester,wmanley/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,wmanley/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester