Avoid overallocating memory in arraypad when using a 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.