Fixed MetaLog writer encoded_length/encode race condition