Check if fd is valid before FD_ISSET
Check if fd is valid before FD_ISSET

Change-Id: I7ad7575b01f17a9847e24f03efa44676ecca6544

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