Which candidate did John Quincy Adams defeat in the controversial election of 1824?