Electromagnetic Casimir piston in higher dimensional spacetimes