Update AbstractBeanFactory.isFactoryBean to only create the merged local bean definition when absolutely necessary.

Comment From: jhoeller

After #23336 and #23337, this seems to be covered and not worth optimizing there anymore.