The interplay between structure and agency in shaping the mental health consequences of job loss