[core] Support Resource Manager HA active / standby switching

Used to only failover when the RM was going down.
Invalidate the current RM API when switching RM.