[PATCH v3 1/3] taskschd: Only release ITaskDefinition if creation of RegisteredTask fails.