Hour Fitness founder Mark Mastrov and LongRange Capital agreed to buy the gym chain he founded and sold over 20 years ago.