If scan-pagemap is run without root priviledges and --shared-mappings
option is used, pids that are inaccessible to the user need to be
removed from the list of interesting pids. Otherwise
dunp_process_maps() will not print any pages for the given processes,
as it will try to count pages that are shared with all interesting
pids. If any pids from the list are inaccessible to the user, then
none of the pages are shared with these inaccessible pids. Therefore,
the inaccessible pids must be removed from the list altogether.
Since list entries are being removed from the list, all
list_for_each_entry will be need to be replaced with the _safe
variant.
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>