add constraint to prohibit logic_id=nil for SOs

SingleOntologies should only be allowed to have
a logic_id of NULL, if there state is not done.

-------------------------------

Should fix #484.