We have many loops that operate on dynamic tags which all crash when
given an ELF with a corrupt dynamic table. Add a helper to walk the
table so we can centralize bounds checking in one place.
Reported-by: Agostino Sarubbo <ago@gentoo.org>