Core/Spells: Possible crash fix

Get Unit target with the proper method instead of retrieving Object target and then casting it to Unit, possible dereferencing NULL.
Updates #11560