py: Use mp_uint_t where appropriate in stream functions.