Five years after an election that showed Algeria riven by protests and staring down an economic crisis, Europe’s hunt for energy has spurred a sharp reversal of fortunes.