core: remove extra space after empty prefix (when prefix for action, error, join, network or quit is set to empty string) (bug #39218)