Update Buffer_SetEndOfBuffer() to handle overflow

Previously calling Buffer_SetEndOfBuffer() on a Buffer object which had
already been filled would result in the end pointer being set 1 byte
after the actual end of the buffer.  This could lead to a 1 byte
buffer overflow.