Structural transition of copper nanowires confined in single-walled carbon nanotubes