allow to return null in the FactoryInterface methods

see https://github.com/symfony-cmf/MenuBundle/pull/37