Ignore the kSocketHasBytesAvailable flag in -hasBytesAvailable

If the process goes to sleep just after the kSocketHasBytesAvailable has been raised but before data has been pumped out, when the device wakes up it is possible that the socket is disconnected. Since the flag is up, the application could be hanging waiting for data that does not exist anymore.

For this reason, we are solely relying on what CoreFoundation tells us about data availability. This workaround has proved fixing hangs in the aforementioned case.
Set additional flags on sockets for extra network safety