Upstream two patches carried by fedora

These two patches were carried by fedora for PIL (and now Pillow, which is replacing PIL in Fedora 19+). Time to send them upstream.