Make pyc generation slightly more robust by adding a length

I think I generated an invalid pyc file by ctrl-C'ing while it was
writing out a file, and it took me a while to figure out why the
parser kept crashing.
Ideally this should be a full checksum.