CA-130011:Prevent xapi from filling it's buffer and running out of memory while reading from an invalid device file

Signed-off-by: Akshay <akshay.ramani@citrix.com>
Merge pull request #1706 from johnelse/ca-130011

CA-130011:Prevent xapi from filling it's buffer and running out of memory while reading from an invalid device file