glthread: replace custom ClearBuffer marshalling with generated one