Tunisia opens gates to end chaos as hundreds stuck on closed Libya border