Dense gas in IRAS 20343+4129: an ultracompact H ii region caught in the act of creating a cavity