Fix some resource leaks in fftlib.c