Fixed onBeforePublish and onAfterPublish exensions

If these are not present some extensions like staticpublishqueue stop working on SiteTree.