hevc: Avoid redundant reallocations for lists of columns and rows.

Also fix a memory leak.