Law firms came ‘dangerously close’ to losing almost a quarter of their associates in 2021, new report says