Accounts: show: check account has invitations

When displaying account details, check an account has a non-empty set of
invitations before attempting to display an invitation.

Fixes http://support.nesi.org.nz/tickets/4578

(Non-migrated accounts from SWITCH VHO are the culprit - they are not finalized
but do not have any pending invitation)
Merge branch 'code-develop' (fix account display) into tuakiri-develop
Version: internal Tuakiri release 1.4.0-tuakiri2
Merge branch 'code-develop' (1.4.0-tuakiri2) into tuakiri-develop