Avoiding Catastrophe: Active Dendrites Enable Multi-Task Learning in Dynamic Environments