MAINT: add NPY_BEGIN_THREAD_NDITER and remove unnecessary needs_api checks

the thread variable is initialized to NULL and checked by the end macro
so the needs_api check is redundant.
ENH: release gil for nonzero
ENH: release gil for np.take and np.arange

implies adapting check_and_adjust_index to allow threadsafe error
reporting.
ENH: release gil for np.packbits and np.unpackbits
Merge pull request #4475 from juliantaylor/gil-release

Gil release for nonzero