wmail: use realloc(3) and handle allocation failures.