The son of one of Panama's most influential leaders has won the country's first elections since it gained control of the Panama Canal.