Three wickets in the final five overs of day three have Australia on the brink of victory in the second Test against Sri Lanka and a series sweep in Galle.