Fix fetching accounts by JIDs

Fixes a crash when publishing an avatar