REF: ensure O(N log N) when using fft for acf

The numpy implementation will fall back to a O(N**2) version of the fft
in cases where it cannot factorize the array length, which can be a
increase in runtime of several order of magnitude. This uses the
_next_regular function from scipy to ensure that we always use array
lengths for which fftpack is optimized.
TST: add test for _next_regular

also copy the test for _next_regular from scipy
Merge pull request #1196 from kain88-de/fast_fft_acf

ENH: ensure O(N log N) when using fft for acf