better error handling for Mojo::IOLoop::Stream