This change improves the robustness of the locklinear test in the
following ways:
* It removes allocations from the timing, which may be very variable if
we're unlucky.
* It ensures that goroutines are properly cleaned up before the test
function returns, reducing the chance that they bleed into repeat
attempts. It also stops timing before this cleanup.
Fixes #32986.
Change-Id: I3a8096e6922f23d899ad602e2845bdfc639ed742
Reviewed-on: https://go-review.googlesource.com/c/go/+/409894 Reviewed-by: Michael Pratt <mpratt@google.com>