The first long-term residents of Stonehenge came from west Wales, a study suggests.