XAPI events fixes

Re-add the fix for the xapi events memory leak, as well as a new fix to register newly-migrated domains with the xapi events thread.