Issue 51136 - dsctl and dsidm do not errors correctly when using JSON
Description: dsctl and dsidm were not returning errors in a JSON object
when the JSON CLI option is requested. This breaks the UI
when errors occur.
fixes: https://pagure.io/389-ds-base/issue/51136
Reviewed by: firstyear & spichugi(Thanks!)