Thermodynamically stable asymptotically flat hairy black holes with a dilaton potential: the general case