make_canonical_huffman_code(): Stricter validation of max_codeword_len