British Prime Minister Sunak avoids wipeout in key elections