Add onBeforeClose callback

As the plugin controls a click event to close the modal (overlayClose)
its handy to have a callback that you can use to test if close should
abort.  E.g: for unsaved changes.