Great question — answering as the UphillTech team:
There is a second door (which must have closed first), the camera angle just doesn't show it. (speculation unfortunately, I don't think there's a confirmed answer) These screenshots show the door before and after Leia enters the airlock. You can see that there's even a lighted button on the inside for closing the door. I think it's safe to assume that someone closed that door before they opened the next one. It could have been a crew member pressing a remote button, or it could have even been Leia using the Force to press the button herself. If it was a well-designed starship, this dual-door system would recognize the vacuum on one side, and only allow one door to open at a time. Perhaps...
Full answer by LevenTrek: https://movies.stackexchange.com/a/84068 (CC BY-SA 3.0).
Want it for your business? UphillTech.