If the driver didn't say "te molesta", it was definitely his own personal way of talking. I have never heard a cab driver ask if it hurts to leave the window open. The other question they usually ask is "¿está bien si dejo abierta la ventanilla?"
Also, when the passenger complains about the cold or they don't ask the driver explicitely to to roll the window up, he might ask: "¿Quiere que le cierre?" "¿Le molesta el aire?"
And thinking about it... if you were coughing or pollution was too bad, he might have used the verb "lastimar" for such a special circumstance.