Jessica Pegula ends Madison Keys' Australian Open title defence to reach the quarter-finals and win a "gross" apple pie bet.