They don't drop into the sun because the velocity of their motion exactly counteracts the force of gravity. Gravity turns out to be a universal force. Everything is attracting everything else. It is still falling toward Earth. When the astronauts want to return to terra firma, they simply slow themselves down a little.
Gravity takes care of the rest.
The astronauts have not escaped Earth's gravity. Many astronauts celebrate their first trip into orbit by losing their lunch. Yes, the Shuttle has barf bags, and plenty of them. You can thank gravity for that.