Core/AI: Fix an issue where the OnQuestAccept hooks were not called for auto-completed quests.

Fixes #11304