Pad array to the specified length with a value