Add function to append n bytes

This adds a function to add the first N bytes from a string into a buffer.
The call to `strncat` will append the null byte for us, afaik.