Don't stop pedaling

Or rather, the easiest way to pedal no-hands is to not alter your cadence at all. If you've worked up a nice rhythm, you're also probably seated in a particular position - the worst thing you can do is take your weight off the bars then alter the distribution of your weight on the saddle.

Also, if you have a road bike, try first letting go with one hand while riding in the drops - the lower position means a lower center of gravity, and gives you a few more seconds to grab the bars if you start to lose it.