I can't fathom not grabbing a hotel for the night??
Istanbul is great at night, throw your bags in your room, go have a couple of drinks and a bite to eat and then sleep in a bed.
IIRC it only takes about 20-30 mins to get back to the airport, so you've got plenty of time for breakfast and a stroll around a fantastic city.