Prime Minister Theresa May has survived an attempt by Tory MPs to oust her with a vote of no confidence.