Fix hanging on tests failing

Tee hanging when `go test` exit with non-zero code.
Fixes #5672
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Merge pull request #5890 from LK4D4/fix_tee_hanging_on_test_fails_#5672

Fix hanging on tests failing