Fix a few int/size_t conversion issues
From https://bugzilla.redhat.com/show_bug.cgi?id=
1127310: the
'#'-variats of parsing (s#, et#, etc.) take a size_t if
PY_SSIZE_T_CLEAN is defined (which the code does). On some
architectures (little-endian only?) this doesn't seem to be a problem,
but on PPC this is a failure in unit tests (at least yay).
The patch changes the type of bufsize to Py_ssize_t, and does an
explicit cast to size_t with underflow check in order to make the code
safer (assuming this is the right thing to do). This should result in
no unexpected conversion issues.