Measurements of electron cooling rates in the midlatitude and auroral-zone thermosphere