Added frame close event cancelling

Adds a check whether the OnClose event handler returned false, in which
case it will not remove the object.
Merge pull request #118 from amPerl/master

Added frame close event cancelling