YamlDumper should dump Definition::$factoryClass setting

It should fix #7542