Wait on shutdown of extra actor systems in tests. #3217

Sometimes the new test is started before the extra actor systems in the old test have shut down leading to too many threads and open file handles.