The previous code would wait for dependencies to become healthy forever,
even if they'd become unhealthy in the meantime. I can't find an issue
report for this bug, but it was described in a comment on the PR that
introduced the `--wait` flag [0].
[0]: https://github.com/docker/compose/pull/8777#issuecomment-965643839
Signed-off-by: Nikhil Benesch <nikhil.benesch@gmail.com>