refactor config property filter decoding and fix some memleaks

all leaks are cosmetic, happen only once during startup and in error
cases. Do not affect performance at all (but valgrind testing ;)).