Fix allocation so there is enough space to put a NULL at the end of the copied env list.