Fix run_upgrade_tests function in run-tests.sh
If an upgrade test failed, that function never exited with a non-zero status. While exit 1 was called, it was in a pipeline, so the exit code was set as the exit code of the last command in the pipeline (tee) which always exited 0. Switch to keeping the status in a separate file (like run_tests). A local variable cannot be used, because the pipeline also makes the block containing the for loop run in a sub shell.