conv: Fix the traceback for tail biting codes

When picking the end state, looking only at the path metric
is highly suboptimal because in a tail biting code, we _know_ that
whatever treillis path is correct, it must start and end at the same
state. So we only consider path meeting that condition. We know any
path that doesn't isn't the right one. We only fallback to only
path metric if no path met that condition.

Fixes OS#4508

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I87e51d3880c0fe7bf3d6cd08fd46517a424a230c
diff --git a/include/osmocom/core/conv.h b/include/osmocom/core/conv.h
index 1c14c3b..84ef0f8 100644
--- a/include/osmocom/core/conv.h
+++ b/include/osmocom/core/conv.h
@@ -124,6 +124,7 @@
                           const sbit_t *input, int n);
 int osmo_conv_decode_flush(struct osmo_conv_decoder *decoder,
                            const sbit_t *input);
+int osmo_conv_decode_get_best_end_state(struct osmo_conv_decoder *decoder);
 int osmo_conv_decode_get_output(struct osmo_conv_decoder *decoder,
                                 ubit_t *output, int has_flush, int end_state);