A much-loved County Durham colliery pavilion has been saved from the threat of permanent closure and transformed into a new heritage museum.