maint: Add local function correct_singularity()

* dietncl/filter/prenorm.lua: New function correct_singularity();
Update function turn_binary_ternary(conn, ncl, ...);
Update function make_compound_tree(ncl)

* tests/test-filter-prenorm.lua: Likewise.