Serena survives scare to reach semis