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