Fix append_ia5 function to not assume NUL terminated strings