BUG: check success of PyArray_DescrFromType in PyArray_InnerProduct

closes gh-5065
ENH: added parameter to use periodic x-coordinates