Fix Issue #3067 fix cumptrapz that was raising an exception when x !=None and axis not in (0, -1)