Fix the heap overflow that crashed the indexing on MacOS

The monitor thread's pthread_t went one past the end of the array,
which has room for the training threads only. glibc hides that in the
slack of the rounded up chunk, the xzone malloc of MacOS stores the
next allocation right behind it and traps on the corrupted heap when
the collocation database is closed.

Change-Id: I1443cc3e5880d7741add7dc2fc6366e4478c7978
diff --git a/src/dereko2vec.c b/src/dereko2vec.c
index d7a783a..7c8bb5f 100644
--- a/src/dereko2vec.c
+++ b/src/dereko2vec.c
@@ -1799,7 +1799,8 @@
 void TrainModel() {
 	long a, b, c, d;
 	FILE *fo;
-	pthread_t *pt = (pthread_t *) malloc(num_threads * sizeof(pthread_t));
+	/* one more than num_threads: the monitor thread gets pt[num_threads] */
+	pthread_t *pt = (pthread_t *) malloc((num_threads + 1) * sizeof(pthread_t));
 	threadPos = malloc(num_threads * sizeof(long long));
 	threadIters = malloc(num_threads * sizeof(int));
 	char *timebuf = malloc(80);