obj_read_bucket() now gets the bucket length as a parameter, because
in many cases, the fastbuf continues after the end of the bucket.
If a V30 bucket ends with a NUL byte, eat that byte as well.
Also introduced obj_attr_to_bucket{,_num}() -- these functions take
a single attribute and encode it using the specified bucket type
for inclusion at the beginning of the bucket header. These functions
probably belong to obj2buck instead, but currently there is no such
file, so I'm leaving the moving to you.