Remove duplicate adjacent directions.