The three-dimensional structure of the giant stellar stream in Andromeda