Robust spin-polarized midgap states at step edges of topological crystalline insulators