nn1dtw_mex: fix double free() or corrupted memory error
nn1dtw_mex: fix double free() or corrupted memory error

When I replaced `calloc` with `mxCalloc`, I didn't fully replace `free`
with `mxFree`. This was causing Matlab to try and deallocated data that
had already been deallocated.

`dtw()` was allocating the wrong number of elements for `cost_prev`

Also:
- added "debug" code (bunch of printfs() to a file in /tmp);
- removed references to `mean` and `std` trough the code;
- added test to see if the window width is negative

rfgiusti/timebox,rfgiusti/timebox,rfgiusti/timebox