SONAR-4898 fix reentrant master termination