Merge "Add tests for fprintf behavior when the underlying fd is bad."