utils: make sure read() string is 0 terminated