Fix memory leak (make sure fftw3 plan is destroyed).