fix cloning of http\Request; add refcount to resource factory