Set elected master id to null when we fail due to too few available instances. Otherwise we won't switch to master when the next election happens.