test(pubsublite): fix flaky TestIntegration_PublishSubscribeSinglePartition (#4493)

diff --git a/pubsublite/pscompat/integration_test.go b/pubsublite/pscompat/integration_test.go
index ab14ad7..77a919d 100644
--- a/pubsublite/pscompat/integration_test.go
+++ b/pubsublite/pscompat/integration_test.go
@@ -554,10 +554,11 @@
 		if _, err := result.Get(ctx); !test.ErrorHasCode(err, wantCode) {
 			t.Errorf("Publish() got err: %v, want code: %v", err, wantCode)
 		}
+
+		publisher.Stop()
 		if err := xerrors.Unwrap(publisher.Error()); !test.ErrorHasCode(err, wantCode) {
 			t.Errorf("Error() got err: %v, want code: %v", err, wantCode)
 		}
-		publisher.Stop()
 	})
 
 	// Verifies that cancelling the context passed to NewSubscriberClient can shut