fft-test: Check memory allocations
fft-test: K&R formatting cosmetics

Also rearrange #includes into canonical order.
fft-test: Pass correct struct members to (i)dct functions

This fixes a number of incompatible pointer type warnings.