Saying thank you to professor & asking for a reference at the same time?
How about if you put it the other way around? Ask for a reference first and add later something like "I'd also like to take this opportunity and thank you for ..." and explain your situation. Then it at least seems less suspicious, since you are asking for something first.

Alternatively, ask for the reference in one email, and if you get a reply, thank him/her in a second email.