[bin} get_preserved_libs: fix scope of the last if condition