Using scoped_ptr in unit class (refactor)

This change aims to simplify the code, making the intents more explicit.
There wasn't a memory leak in the previous version, but it could easily be
introduced in the future.

Also, RAII is part of the coding standards of Wesnoth, as noted in the wiki.

There are other raw pointers in the unit class, but unit don't own them, then
I leave them unchanged.