[ticket/12517] Correctly call $log->add in prune shadow topics

Ticket: https://tracker.phpbb.com/browse/PHPBB3-12517

PHPBB3-12517