Fix 'get_review_ids' function
Fix 'get_review_ids' function

The previous implemention had problems detecting cicular
dependencies. Added helper function and the output
'review_ids' array is passed as a parameter.

Previously, the cicular dependencies were found only when
the whole recursive tree is discovered. This was impossible
when having a circular dependency.

ionutbalutoiu/mesos-jenkins,ionutbalutoiu/mesos-jenkins