doc: Use `finally` for teardown in doco examples

This should encourage better handling of non-^C exit conditions in API
based use.
5 files changed