Canonical and microcanonical ensemble descriptions of thermal pairing within BCS and quasiparticle RPA