freing allocated memory for fftw plans and arrays