Self-stabilizing leader election in dynamic networks