Correctly quote config values while saving

If the value contains a command (; or #) char or starts or ends with space it needs to be quoted.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Add a testcase for values which needs quotes

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Add another testcase to make sure double quotes are correctly escaped

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Rename method

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Merge pull request #1950 from csware/quote-config-values

Correctly quote config values while saving