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

Fixes #11304
Core/Quests: Fix an issue where auto-completed quests would not be automatically completed if the quest was added through either the SmartAI action_type SMART_ACTION_ADD_QUEST, the spell effect SPELL_EFFECT_QUEST_START or the opcode CMSG_QUEST_CONFIRM_ACCEPT. Also fixes auto-complete quests in the SAI and opcode case not calling the AI hook.
Scripts: fix crash in spell_jokkum_scriptcast

Closes #11313
Merge branch 'master' of github.com:TrinityCore/TrinityCore
Core/Player: Fix questgiver spell cast.
Core/Unit: Add switch to prevent COMMAND_ATTACK being added to action bar for supplied creature entries.
Core/Misc: Remove unused code

Remove unused debugging code added in MaNGOS r5067.
Remove dead code from a switch found by Coverity.