Refresh metadata if all partitions are in election

Otherwise the producer gets stuck with a stale cache