msg: insert PriorityDispatchers in sorted position
avoid calling stable_sort() after every insertion by inserting directly
into the sorted position. use lower_bound() to insert at the head and
upper_bound() to insert at the tail
this generally only happens during startup so isn't a performance
problem, but std::stable_sort() was triggering strange valgrind warnings
for "Mismatched free() / delete / delete []" when it allocates a
temporary buffer
Fixes: https://tracker.ceph.com/issues/66336
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit
063d100526e9e5ece31d575568e0910806f8e74d)