Treating surfaces of moulds, cores, or mandrels to prevent sticking