On the metric properties of dynamic time warping