[ticket/11445] optimize number of queries in get_global_subscriptions

PHPBB3-11445
[ticket/11445] Add unit test for get_global_subscriptions method

PHPBB3-11445