Use realloc(9) instead of doing the reallocation inline.

Submitted by:	bde
MFC after:	1 week