ENH: Small speedup of FFT size check

Use a bit-twiddling power of 2 check instead of repeatedly dividing by 2
ENH: Use floor division instead of float division

This uses from __future__ import division, but if n % c == 0, n / c == n // c
TST: fftpack: add tests for _is_safe_size
BUG: fftpack: fix _is_safe_size for n=0
Merge pull request #3670 from pr-3670

ENH: fftpack: small speedup of FFT size check

Use a bit-twiddling power of 2 check instead of repeatedly dividing by 2.
Add tests.