Improve method replacing when using the Apple runtime.

This prevents replacing the method of a superclass when the method is
not implemented in the class and creates a new method instead.