Core/Scripts: fixed memory leak caused by unassigned scripts in db
Core/Scripts: Fix invalid memory write

Fix invalid memory write caused by calling "delete this;" in a base class constructor.
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore