Theresa May's minority Government has survived its first test of the new Parliament by defeating a Labour amendment to the Queen's Speech.