Patch to enable checks against numpy dtypes as well as types attached.

Why...?
Not all numpy types are created equal!
Consider this (on Windows, works as expected on Linux):

import numpy as np, numexpr as ne
from osgeo import gdal_array
a = np.array([1], np.int32)
b = ne.evaluate('a')
print 'dtypes:',a.dtype,b.dtype
print 'types:',a.dtype.type,b.dtype.type
print 'Compare dtypes (expected output True):', a.dtype==b.dtype
print 'Compare types (expected output True):', a.dtype.type==b.dtype.type
print 'Compare a.dtype.type to np.int32 (expected output True):', a.dtype==np.int32
print 'Compare b.dtype.type to np.int32 (expected output True):', b.dtype.type==np.int32
print 'b.dtype.type is actually a np.intc:', b.dtype.type==np.intc
print 'NumericTypeCodeToGDALTypeCode(a.dtype.type):',gdal_array.NumericTypeCodeToGDALTypeCode(a.dtype.type)
print 'NumericTypeCodeToGDALTypeCode(b.dtype.type):',gdal_array.NumericTypeCodeToGDALTypeCode(b.dtype.type)

This outputs:

dtypes: int32 int32
types: <type 'numpy.int32'> <type 'numpy.int32'>
Compare dtypes (expected output True): True
Compare types (expected output True): False
Compare b.dtype.type to np.int32 (expected output True): True
Compare b.dtype.type to np.int32 (expected output True): False
b.dtype.type is actually a np.intc: True
NumericTypeCodeToGDALTypeCode(a.dtype.type): 5
NumericTypeCodeToGDALTypeCode(b.dtype.type): None

With the patch applied, I can pass b.dtype:

print gdal_array.NumericTypeCodeToGDALTypeCode(b.dtype)
5

gdal_array.i.patch (v. 2)