osd: handle misdirected do_command

If we get a query after the primary changed, we blindly plow ahead and
then assert in one of the stat update methods that the 'query' command
calls.  We shouldn't do anything if we aren't primary.