Cleaned up Lua event subscription code (do not register C++ handler before Lua function is found successfully.)
Moved Lua script object destruction to a function.
Destroy the old Lua script object before creating new.
Unref the object specific event handler functions when destroying Lua script object.

git-svn-id: http://urho3d.googlecode.com/svn/trunk@2565 3bd170d8-ddcf-f82c-f583-7a401ccf5608