Despite Q2 losses, Rite Aid's on the right track