Staff absences due to mental health has cost the fire service more than £500,000 in the last three years.