Thermal oxidation of polyacrylonitrile