The band’s new album is one of the most energetic party records of the year, but it was in fact a product of some struggle