[fixes #51393927] Use the inbox count for inbox count

Calling .empty? on the inbox scope generates an SQL
request which attempts to join across half the database.
This takes ages. Fortunately the inbox scope already
provides a special count action, which we can use instead.

This makes inboxes much faster.
Merge pull request #764 from JamesGlover/51393927_pipeline_inboxes_take_ages_to_load_revised

[fixes #51393927] Use the inbox count for inbox count