Simulations of Emerging Magnetic Flux. I. The Formation of Stable Coronal Flux Ropes