Allocate with calloc, not malloc

Make sure the memory is initialized to 0, so that untouched array values
have sensible values (for example, when no devices are present in a
platform, `num_devs + p` could be untouched, and we want it to be zero
in that case).