unix: don't call testing.T.Fatalf in a background goroutine

> Those methods [...] must be called only from the goroutine running the
> Test function.

For golang/go#43498

Change-Id: I847067936ade613a21b059c90219bd285425f0aa
Reviewed-on: https://go-review.googlesource.com/c/sys/+/280622
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
diff --git a/unix/syscall_unix_test.go b/unix/syscall_unix_test.go
index 41de3b8..e9cc5b1 100644
--- a/unix/syscall_unix_test.go
+++ b/unix/syscall_unix_test.go
@@ -906,14 +906,17 @@
 	go func() {
 		n, err := unix.Write(w, []byte(s))
 		if err != nil {
-			t.Fatalf("bad write: %s\n", err)
+			t.Errorf("bad write: %s\n", err)
+			return
 		}
 		if n != len(s) {
-			t.Fatalf("bad write count: %d\n", n)
+			t.Errorf("bad write count: %d\n", n)
+			return
 		}
 		err = unix.Close(w)
 		if err != nil {
-			t.Fatalf("bad close: %s\n", err)
+			t.Errorf("bad close: %s\n", err)
+			return
 		}
 	}()
 	var buf [10 + len(s)]byte