Implications of an internal dynamo for the thermal history of Mercury