Break from waitpid loop when it -1 or 0
Break from waitpid loop when it -1 or 0

Change-Id: Ifb309b0a568177774a9f12011e31877cec06ffc6

cloudfoundry-incubator/garden-linux,cloudfoundry-incubator/garden,shashidharatd/garden-linux,cloudfoundry-incubator/garden,savaki/garden,shashidharatd/garden-linux,savaki/garden,shashidharatd/garden-linux,cloudfoundry-incubator/garden-linux,tangfeixiong/garden,shashidharatd/garden-linux,tsaleh/garden,tsaleh/garden,cloudfoundry-incubator/garden-linux,tangfeixiong/garden