Does a fallen tree left to decay release essentially all of its stored carbon as CO2 to the atmosphere? Or is the carbon uptaken by termites and bacteria, preventing its release to the atmosphere?
I Can't quantify the answer, but intuitively, nearly all of a burning tree's carbon is converted to CO2 - assuming the fire is hot enough. You are correct in assuming that termites and bacteria convert some of the carbon to other organic species, as do fungi, yeasts, moulds, and slow weathering. In addition, some of the rotting tree's carbon is converted to soluble inorganic ions, humic, fulvic and tannic acids. So no, organic decay would not yield the same CO2 as burning.
This would make an interesting school or 1st-year uni science experiment. Burn some wood in a sealed environment, measure the CO2 evolved, then repeat the experiment with wood in a wet organic-rich isolated biome, and compare the results. I suspect it would make for an interesting paper with potential climate change policy implications.
The key word in your query is the word "essentially". Termites and bacteria die too. So whatever carbon was initially converted from the tree into termites or bacteria ends up mostly going to CO2 also.
Of course some carbon gets converted to carbonate and that can combine with calcium to form the mineral calcite. The tree can also get buried in mud and over eons get converted to coal or oil.
It's not so much the amount of CO2 released but the rate at which it would be released that contributes to the Greenhouse effect. Burning will release CO2 faster than any form of natural decomposition
Burning wood for home heating could actually be a carbon credit. Wood offsets combustion of oil, natural gas, propane, and the use of coal fired generation of electricity. Wood left to rot, as the previous post note, is carbon neutral.