Add a StreamResult decorator safe for use in threaded/concurrent code.