torrent: add some minor error catching.