Stability of periodic orbits in the averaging theory : applications to Lorenz and Thomas' differential systems