Fix gdb could not get shared library list issue

Get dynamic flags from phdr table's correct entry rather the first
entry, so that the following DT_DEBUG entry can be set.

Also fix the undefined reference to LoadTask::deleter issue under gcc
-O0 option.

Bug: 17524778

(cherry picked from commit e93be99da0614ff38cbf8b2bb0624ff1dc79b8d0)

Change-Id: I347792dab25c7b19c3fc690e03d20899ce1e26e0
3 files changed