lavapipe: use ralloc for pipeline copies.
We have to store every struct that is in the pipeline for processing later, use ralloc to make freeing this mess easier.
Also added a common macro, and don't copy pNext we don't parse.
@kusma this is a precursor for fixing vertex divisors.