Fix polymorphic application for callback protocols (#16514)
Fixes https://github.com/python/mypy/issues/16512
The problems were caused if same callback protocol appeared multiple
times in a signature. Previous logic confused this with a recursive
callback protocol.