From Lukasz Janyst: Fix segfault in libNetxNG.so when reading a file on EOS

This should fix the Jira issue #ROOT-6507: Segfault in libNetxNG.so when reading a file on EOS
- Check status codes before deleting them
- Use a variable large enough to handle offsets