I have some friends who do this a lot, though I have yet to participate.
I believe that, as depeanut says, the charring helps provide a seal to prevent contamination. Also, as you note, there's quite a bit of ethanol present from the liquor that was first aged in the barrels; that is really the whole point! And the alcohol absorbed in the wood and present as vapor in the interior all help keep things sanitary. And then this is all aided by the fact that it is generally pretty high-alcohol beers that are aged in them.
I've tried a few of the end products, and man are they gooood!!