libwinpr-clipboard: fix memory corruption and leaks