incref and decref in error case of dtype is missing here, probably causes the debug test failure.
this is also a bug in current numpy but not triggered as the old code gets the key stride from the array, it might be better to fix it in master first and then rebase the branch.