Students occupying a building at the University of Glasgow have ended their protest.