Various fixes so that copying to Windows clipboard works with
Python3/ST3 and 64-bit Windows.