Fixes for Python3 pickling
Fixes for Python3 pickling

For Python3, we need to read as bytes, and so use a new format string
to build the buffer for pickle.loads(). Similarly, we must take care
to convert the byte buffer on writes.

Note that we can smoothly upgrade from Python2 to Python3, but
downgrades don't work because even the ASCII protocol we force
cannot mask the fact that Python3 seems to store complex objects
using Unicode internally, which Python2 then does not like:

kate(6091)/Kate (Plugins): "Traceback (most recent call last):
  File "/usr/lib/python2.7/pickle.py", line 1382, in loads
    return Unpickler(file).load()
  File "/usr/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/usr/lib/python2.7/pickle.py", line 1133, in load_reduce
    value = func(*args)
TypeError: must be string, not unicode
No result from pickle.loads"

Nevertheless, we ensure that we explicitly use protocol version 0
(Python3 changes the default to something Python2 cannot
understand!) so that at least simple types survive a downgrade.

cmacq2/kate,hlamer/kate,hlamer/kate,DickJ/kate,hlamer/kate,hlamer/kate,cmacq2/kate,jfmcarreira/kate,sandsmark/kate,hlamer/kate,cmacq2/kate,hlamer/kate,sandsmark/kate,hlamer/kate,DickJ/kate,hlamer/kate,jfmcarreira/kate,hlamer/kate,DickJ/kate,DickJ/kate,jfmcarreira/kate,sandsmark/kate,hlamer/kate,sandsmark/kate