osd: Prevent divide by zero in agent_choose_mode()

Fixes: #8175


Backport: firefly

Signed-off-by: David Zafman <david.zafman@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>