osd: add osd_snap_trim_max, throttle SnapTrimmer

We have observed that following a backfilling of a PG to a new OSD
occasionally the purged_snaps list is emptied. This results in the
SnapTrimmer needing to re-trim all of the previously purged_snaps,
which can take O(minutes) and blocks the OSD during this time.

In this commit we add a new configurable, osd_snap_trim_max, which
sets a limit on the number of snaps to trim per SnapTrimmer
context. After the limit is reached, the SnapTrimmer requeues to
trim the remaining snap_trimq later (after osd_snap_trim_sleep,
ideally).

We set osd_snap_trim_max to 16.

Reviewed-by: Sage Weil <sage@redhat.com>
Tested-by: Florian Haas <florian@hastexo.com>
Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
(cherry picked from commit bfd38a05113cbb044d0702176c7f55790832a24c)