two-body problems can still be solved analytically, you can reduce it to a one-body problem with fixed center. just replace the orbiting body's mass by its reduced mass (µ = (m*M)/(m+M)).
besides, circles are not the only stable orbits; in fact, any orbit is stable since the effective potential includes a repulsive centrifugal term which goes ~ 1/r^2, while gravity is ~ 1/r, so in principle you can't ever reach the center.
there are two orbit types (in theory there are three but the third one is not interesting):
1. passing by (high velocity): you get nearer to the center, pass by it and then fly away and never come back
2. oribt: everything else, you're captured in the potential. always stable

with stable i mean, of course, that the planet never falls into the sun. this is not correct, obviously, since the sun has a specific diameter and like that even not reaching its gravitational center could destroy the orbiting planet.

as for the moon: it is not a perfect perpetuum mobile, mostly because it pulls on earth's water and the friction on earth then drags energy out of the moon.