Rite Aid swings to profit in Q3, lifts forecast