tty: make init functions accept buffer parameter
Change PosixTty and WindowsTty init functions to accept a buffer slice
instead of creating a fixed-size buffer internally. This allows callers
to control buffer size and allocation strategy.
The buffer field in both structs is changed from [4096]u8 to []u8,
and the init functions now take a buffer: []u8 parameter that gets
assigned to the struct field.
Amp-Thread-ID: https://ampcode.com/threads/T-1502f393-0cb2-4350-975b-5c6305f60969
Co-authored-by: Amp <amp@ampcode.com>