Refs #10051. Fix valgrind warning in DynamicFactoryTest