libfreerdp-core: fix memory leaks reported by valgrind