Khawaja inspires Qld comeback against SA