Properly close ramdisk if magic read operation fails