Generative multitask learning mitigates target-causing confounding