Fix erc bug when there's two channels with the same name

* lisp/erc/erc.el (erc-generate-new-buffer-name): Fix logic when
there's two channels with the same name from two different servers
(bug#40121).
1 job for master in 58 minutes and 39 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Test
failed #6799
test-all

00:58:39

 
Name Stage Failure
failed
test-all Test
Makefile:318: recipe for target 'check-doit' failed
make[2]: *** [check-doit] Error 1
make[2]: Leaving directory '/builds/emacs/emacs/test'
Makefile:293: recipe for target 'check-expensive' failed
make[1]: Leaving directory '/builds/emacs/emacs/test'
make[1]: *** [check-expensive] Error 2
make: *** [check-expensive] Error 2
Makefile:959: recipe for target 'check-expensive' failed
ERROR: Job failed: exit code 1