China sentences 39 on terrorism charges in crackdown