pub fn borrow_stdio<F, T>(f: F) -> Result<T, Error> where
F: FnOnce(StdinStream, StdoutSink) -> Result<T, Error>,
"Borrow" the stdio streams to make them accessible to Tokio.
We make a best effort to clean up after the inner function is done, but the stdin reader thread might stick around for the life of the process if it is stuck blocking on a stdin read. It is therefore possible that a chunk of stdin I/O will be lost.