Angular dependence of high-transverse-momentum inclusive π0 production in π±p and pp interactions