gdb/solib: use owning_intrusive_list for solib list

Functions implementing `solib_ops::current_sos` return a list of solib
object, transferring the ownership to their callers.  However, the
return type, `intrusive_list<solib>`, does not reflect that.

Also, some of these functions build these lists incrementally, reading
this from the target for each solib.  If a target read were to throw,
for instance, the already created solibs would just be leaked.

Change `solib_ops::current_sos` to return an owning_intrusive_list to
address that.  Change `program_space::so_list` to be an
owning_intrusive_list as well.  This also saves us doing a few manual
deletes.

Change-Id: I6e4071d49744874491625075136c59cce8e608d4
Reviewed-by: Keith Seitz <keiths@redhat.com>
10 files changed