I can't be the only person to have asked this question out of genuine curiosity. In fact, thinking back I may have asked it several times, each time simply wondering what the other person was thinking.
The last time I asked it, I got a genuine response, and it sparked off a small but not insignificant conversation. I really don't think it was viewed by the girl in question as an attempt to antagonize. At least, I hope it wasn't.
Similarly, whenever I'm asked this question, I try to answer it. Since most of us are thinking about several things at once, all the time, it shouldn't be too hard to pick the thought stream that's the least incriminating/boring/nonsensical and offer a thoughtful or, failing that, witty response. "I was wondering what those ceiling tiles are made of," however, is probably not as inspired as you might think.
Of course, I respect an answer indicating that the owner's thoughts are private, and will remain that way. This can even be construed as cute, or sexy... depending on when/where the question was asked.
I often wonder at the amount of psychological maneuvering that goes on in most relationships, budding and established alike. It can't be healthy to analyze minutely every single sentence, looking for a catch or ulterior motive. Most people would agree that confident, relaxed people who seem comfortable with themselves and their surroundings are the most attractive ones. So what do you think it does for your image if you freeze and make warding gestures every time somebody asks you what you're thinking?
I don't deny that sometimes, this question is a trap. And it's important to recognize these instances and deal with them accordingly. You can be relaxed and genuine without being naïve.