I'm no doctor (yet!), but I'm 100% sure skin cancer doesn't pop and reslease pus!
It was most probably a blackhead, yes. If it's been festering in your skin for a long time as you say, there will be lots of bacteria and as gross as it is, yes it does smell. Subaceous cysts are renowned for smelling pretty nastily when released, and they, technically, are also harmless.
Relax.