There is no secret. OctoMap was not really designed with pose refinement in mind. You can even see one of the authors of RGBD-SLAM mention it here.
If you did want to try and still use octomap with loop closure then the approach that you mention could work. You could probably make it a bit more efficient by only deleting the poses in Octomap that were affected by the loop closure.
One possibility you could also use is to utilize the probabilistic aspect of OctoMap. On your first run set the pointclouds to have a very low probability. With the loop closure update you then add another set of pointclouds with a much higher probability. Octomap will take care of the fusing for you so this idea could work.
If you do ,however, want mapping software that is built to deal with changing poses due to loop closure and bundle adjustment then I would advise you to look into Thomas Wheelans work on deformable pose graphs specifically with Bundlefusion and Elasticfusion.