fix(diagnostics): handle WouldBlock in stdout writes to prevent panic
#20295
+12
−3
WouldBlock in stdout writes to prevent panic
#20295