get rid of dodgy errno globals

all functions now return their result code. Points to lengths are more important.
shrink an int
add length function
add lame-duck versions with NULL output pointers
fix copy-pasta
add HPACK string encoding