Fix the sample to await when writing directly to the output stream in a controller.