Replace run-loop calls with local equivalents in CI tests

It is dangerous to require run-loop in the CI tests because run-loop is installed and uninstalled repeatedly during the tests.