Make Vec::clone and slice::to_owned failure-safe