Use OpenBSD's reallocarray instead of realloc(p, s * n)

Use OpenBSD's `reallocarray` in the super-rare case that fd * sizeof int causes an integer overflow.