A slave captured by Islamic State was sold to a Melbourne family living in Syria for sex and housework, a court has been told.