Fix binary erosion and dilation for NumPy 1.8