RF: refactor pyx / c file stamping for packaging

Yarik was finding it annoying to have the stamping procedure inside the
sdist procedure, so pull it out so we can use it to build and stamp
pyx and c files in the source tree.