Replacing ref/unref calls by the use of std::shared_ptr.

The transition will be progressive and everything should continue to
work during it.

During the transition phase, our old refcount system remains in place,
and objects managed by std::shared_ptr actually use it though a custom
deleter. This is temporary, this is only to allows both systems to
coexist during the transition.

After the transition, the old refcount system and the special deleter
will be removed. Objects will use the standard deleter of
std::shared_ptr.
Don't create several shared_ptr from the same raw pointer.

Otherwise they don't share the same ownership group and the object may
be deleted twice.
Merge branch 'cpp11' into shared_ptr
Use shared_ptr instead of old refcounts for Lua userdata.
Use placement delete to destroy the shared_ptr allocated by Lua.
Fix userdata collected too early.
Remove TODO
Update comment.
Merge branch 'cpp11' into shared_ptr
Store map entities in shared pointers.

Not done yet for tiles and for the hero.
Fix a memory leak due to a cycle in refcounts of custom entities.

The faulty code will be simplified anyway, but for now the leak is
fixed.
Add a class to manage the lifetime of Lua refs automatically.
Merge branch 'cpp11' into shared_ptr
Use scoped Lua refs in custom entities.

With this, we can remove destructors, copy constructors and assignment
operators. ScopedLuaRef takes care of ownership.
Fix detection of empty traversable info.
Fix wrong assignment.
Fix wrong move constructor.
Use a reference.
Use map[key] = value instead of map.insert(std::make_pair(key, value)).

The version with insert does not work and I don't understand why.
Merge branch 'cpp11' into shared_ptr