Spoiler There is a dossier on Ulfric in the Thalmor Embassy.
He is not mentioned as an agent, nor is there any evidence that he is actively and knowingly working for the Thalmor or trying to advance their agenda (which is what being an actual "agent" would entail).
He is mentioned as an asset because the Thalmor believe that some of the things he does, or is likely to do, can be exploited by them to their own advantage.
Incorrect,
Spoiler the dossier states that a Stormcloak victory is to be avoided.
The Thalmor would prefer to see the war go on as long as possible with no clear winner. If either side wins too quickly, neither side takes as much of a hit to their resources and manpower. The longer it goes on, the bigger a hit both sides take no matter who wins.
In the event that either side does emerge as a clear victor, I think they would prefer it to be the Empire as that would mean they could continue their enforcement of the WGC in Skyrim with Imperial backing and protection, which also means they could continue whatever intel gathering and surveillance they are doing in the process. If the Stormcloaks win and secede from the Empire they will no longer be bound by the WGC and I think it's safe to say that overt Thalmor activity in Skyrim will not be tolerated by the new regime insofar as they can prevent it.
each side when they win have pros and cons to the Thalmor I believe.
Stormcloaks win
-pro-The empire will lose a big province with much resources, divide and conquer.
-pro-seeing how "short sighted" Ulfric is, he will never make an alliance with the empire. even an alliance with Hammerfell will be filled with tensions, a problem which would never be present in a united empire.
-con-As you said, the Thalmor wouldn't be able to walk around Skyrim and take Talos worshippers and keep an eye around.
Imperial win
-pro- They still could regulate and stay around in Skyrim, spying and killing resistance to the Thalmor.
-con- an united empire is going to be hard to beat in the future, and there are no relation problems in this case.(which would be present if Stormcloaks win.
-con- Extra recources, means that the Empire can rearm its forces faster, much faster than the Thalmor can.