Yes, you can draw and throw a weapon while still using a two-handed weapon for opportunity attacks
According to the PHB Errata, you only need two hands to attack with a polearm, not to wield it.
Two-Handed (p. 147). This property is relevant only when you attack with the weapon, not when you simply hold it.
Per Jeremy Crawford (no longer official rulings, but still a strong indication of RAI), it is a non-action to switch between one and two hands:
@calebrus44 27 Feb 2017
He's basically saying that switching between 1 or 2 hands is a non-action.
@JeremyECrawford 27 Feb 2017
Replying to @calebrus44 @SimonsOrion @mikemearls
That's correct.
This interpretation is supported in-game by two-handed weapons which use ammunition, for example the longbow; As part of the (potentially multiple) attacks, you must take a hand off the weapon to draw ammunition, then grasp it again, without using your free object interaction.
As always, it is best to check with your GM. As this is somewhat of a grey area in RAW, some tables may be more restrictive and rule that swapping to a two-handed hold requires your free object interaction.