Add support for writing jpeg files.

This is based on the code written by Rene Dudfield for imagext.c in
pygame. It's relicensed based on a conversation we had via Twitter
DM.