fft: fixed bug with occasional rewriting of the input array