Fix double-free issue in File::create