extapi: clone to return own object type

Credit: Arik Hadas <ahadas@redhat.com>
Change-Id: I7341e25763114c549dffb6218979aec6c38cfde5
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>