fixed: some issues pointed out by valgrind

cherry-picked from @notspiff I dropped the change in CWinEventsX11Imp::CWinEventsX11Imp from original commit.
From the source of tiny it's not possible as far as I can tell.  Even when compiled without STL it returns a pointer to a NULL terminated string, thus can't be NULL.  I would be surprised if this depends on version - the STL mode just returns std::string::c_str() and the non-STL mode emulates that by doing a similar thing.

Still, I have no problem switching to ValueStr() - usually that's what we want anyway.  I have a branch to do just that in progress (though not that far along).