use escapeshellarg() instead of esc_cmd(), because the $editor variable can contain %s

see #822