Backport #3033 to 0.13.x

Backport ndimage.label bugfix #3033 for maintenance/0.13.x

See https://github.com/scipy/scipy/issues/3049