Add timeouts on the `curl` commands which are executed in loops in order to to catch potential issues and avoid infinity loops