Shanghai, Greece set off global stocks rout but US escapes