qcow2: Improve error handling in update_refcount