Echo false in {setloglevel,setsecurity} when an exception is thrown.

Should fix #5156 (i.e. restore expected behaviour).

@kabum Please give this a try.