This MR enabled Style/InfiniteLoop Rubocop cop, and fixes offenses.
See https://gitlab.com/gitlab-org/gitlab-ce/issues/17478