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.
Merge branch 'master' into preview_bytesio

Conflicts:
	sympy/interactive/printing.py
Merge pull request #2398 from asmeurer/preview_bytesio

Change preview to use BytesIO instead of StringIO