Make sure non-ascii output from commands does not crash exec plugin.
fix #2599, #2366, #2203