Structural phase transitions and topological defects in ion Coulomb crystals