Is it possible to finish the main quest and stay neutral in Skyrim's Civil War?
Solution 1:
Yes, it is possible. The main quest is not completely independent of the war, but it does not require your character to take any action to support or oppose either side in it. You won't need any advice or hints as to how to avoid taking a side; the game will tell you what you need to know when you get there. I hadn't realized it before, because I wasn't in this situation myself, but some thought seems to have gone into making this work out.
Solution 2:
You may have to take an oath to complete the main quest. I completed both of the "intro" quests for each side so they were both asking me to take an oath, but I didn't do it. In the mainline quest you need to talk both sides into attending the conference. When you talk to Ulfric, he'll say "are you ready to take the oath, or do you have something else to talk about". You can tell him something else and get him to join the conference. But the problem comes when you talk to the Imperials. General Tullis will only give you one choice - take the oath. at this point, in order to get him to talk about something else, you will have to choose a side.
Solution 3:
The only time the main quest comes into any contact with the rebellion is when you have a council meeting with the Greybeards. If you took the rebels side, you will offer advice and give opinions to the rebel side.
So really it was just dialogue choices that are different for that brief section of one main quest.
Solution 4:
You are able to avoid joining the Stormcloaks or Imperial Legion and still complete the main quest line. You don't need to do anything special to achieve this. As part of the main quest, there is a war council where you have the possibility to favour one side or another (or neither, if you want to be an even-handed Dovahkiin), but that's it.
You seem concerned about one side or the other supporting the Thalmor. Let me hint, then, that the game suggests that a war with the Aldmeri Dominion in the future is more than likely regardless of which side you choose. In fact, dialogue at the end of both the Stormcloak or Imperial Legion storylines hints at the preparations Skyrim will undergo to ready themselves for this eventuality.
Solution 5:
As Luke said, if you started the Initiation for the Stormcloaks or the Imperials before the big meeting at High Hrothgar, you will have to join a side (take the oath) or the main quest can not be continued when it comes to inviting Tullius.
Avoid talking to any of the two Faction leaders about joining them under any circumstances if you want to stay independent during the main quest!
BTW: Thalmor are not impressed by joining the imperials, especially when it comes to pardons for certain prisoners...