Stability of homomorphisms in the compact-open topology