catch network exceptions when transferring data

This fixes #78 by moving the call to f.read() inside the exception-handling
structure of _safe_open (now _safe_read). The function now returns a string,
which util.bytes_to_elementtree has been modified to accept.

Signed-off-by: Adrian Sampson <adrian@radbox.org>