osd/OSD: fix track_pools_and_pg_num_changes on mapgaps
* track_pools_and_pg_num_changes call is moved before the superblock updates to
know if we have any OSDMaps *before* trimming them (if possible).
This is used to identify map gaps.
* track_pools_and_pg_num_changes inner loop is moved into
_track_pools_and_pg_num_changes.
* lastmap now starts with the newest_map we have, even on mapgap.
Previously, on mapgaps, we would (falsly) assume that this is the first start
of this OSD and would ignore the state before the gap. This case
is fully described in the tracker below: