History and future of the Martian dynamo and implications of a hypothetical solid inner core