add dynamic symbol linking support (again)

a flaw in the logic that selected rela entries for inclusion caused entries in .rela.parainstructions to be selected for dynrela replacement, which resulted in the bug that prompted the revert.

fixed some deeper rooted issues like symbols pointing to invalid sections, duplicate generation of rela sections.  also added some proper teardown and free functions for the core struct kpatch_elf data structures to help with debugging.