Reduce memory leaks in libNeedleman.c