Exactly energy-conserving electromagnetic Particle-in-Cell method in curvilinear coordinates