Primitive potentials and bounded solutions of the KdV equation