Avoid overallocating memory in arraypad with user supplied function

Previously, arraypad used zeros(shape).astype(dtype) instead of
zeros(shape, dtype), which could allocate up to eight times more memory
than necessary.