Essentially, lib_link_all would perform some post-processing over data
in given bmain that may fail when not all data from all libraries
has been properly loaded yet.
This happens when lib_link_all is called from read_libraries, where
the bmains are split by libraries.
Now those post-processing is put into its own utils function, which
asserts that it is only called on a merged bmain.
Bonus point, this will avoid re-runing those not-so-cheap operations
more than once on the same data.
Reproducible in r1442 of Sprite repository when opening
pro/animation_test/rex/performance/rex_crowdcamping/rex_crowdcamping.lighting.blend
NOTE: Not so sure why we have to call lib_link_all several times (once
for each library, and then once on the whole merged bmain, including
local IDs then0. So that it can get called for libs while we still have
that specific .blend file handle around?
in any case, the overhead here is minimal since we do ensure a data-block is
never lib-linked more than once, so this is not a serious concern right now.