ENH: use intrinsics for isnan, isfinite and isinf

Use of intrinsics avoids expensive function calls in tight loops on x86
cpus where these operations are implemented in hardware while still
retaining same portability.
More than doubles performance of np.isnan/isinf/isfinite.
MAINT: check for intrinsics at configure time
ENH: add possibility to add define_macros to extensions
MAINT: mask npy_config.h include with HAVE_NPY_CONFIG_H
MAINT: document intrinsic macro guards
MAINT: document why OPTIONAL_INTRINSICS needs arguments
Merge pull request #3308 from juliantaylor/optimize-isnan

ENH: use intrinsics for isnan, isfinite and isinf