Change preview to use BytesIO instead of StringIO

This fixes it to work in Python 3. Since BytesIO is available in Python 2.6, 
the use of StringIO has been deprecated. See 
https://code.google.com/p/sympy/issues/detail?id=3984.

This fixes, in particular, init_printing(use_latex='png') in Python 3.