UK finally leaving European Union after its last legal obstacle removed, over three years after voters narrowly opted to separate from bloc