Fifteen years after NATO helped topple Gaddafi, North Africa’s military powers appear to have drawn a lasting lesson from Libya’s collapse, spending more than $320 billion on stronger militaries, advanced weapons and deeper alliances to ensure they are not caught as exposed in a future crisis