osd/OSD.cc: Use MIN() so that we don't exceed osd_recovery_max_active

Caused by 944f3b73531af791c90f0f061280160003545c63

Fixes: #6291

Backport: dumpling

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
osd/ReplicatedPG.cc: Verify that recovery is truly complete

Backportable change to insure that even if no new ops started or
are running that indeed recovery is complete.  Prevents some
error condition or unforseen code path from crashing an osd.

Backport: dumpling, cuttlefish

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge branch 'wip-6226'