Update builds API after introducing pipelines
Currently we have a regression in builds API related to fact that we can have multiple pipelines for given commit.
See https://gitlab.com/gitlab-org/gitlab-ce/issues/18476#note_12598963
/cc @ayufan @markpundsack