Add native calls for activity closing events.

Two native calls wxUnregisterFrame(...) and wxEnd(...), they are needed for implementation of corresponding events, such as OnClose().

They are also required for deleting global references and removing activities from activity stack.
Set variable to NULL after it is used.

wxRegisterFrame() should only be called if new wxFrame/wxDialog is shown, this way we make sure single object doesn't get changed/registred twice.
Add onDestroy() events to activities in java.

Native activities wxEnd() and wxStart() will now get called when those activities shut down.