matplotlib v1.3.1 fixes for Cygwin

This patch didn't land into Cygwin.  Shouldn't affect Linux builds so I'm going to merge this one in.