Fix possible overflow in strbuf_append
Fix mingw32 building