On the production of nitric oxide by cosmic rays in the mesosphere and stratosphere