Stan Wawrinka won a bad-tempered clash with Jo-Wilfried Tsonga to reach the Australian Open semifinals.