This should make test failure analysis easier.
Added test case that checks that relay master status is not lost when IO thread is stopped.