fix(lp): work more carefully with basis heading in the dual

Signed-off-by: Lev Nachmanson <levnach@microsoft.com>