Write EventSource events with metadata to EventPipe (dotnet/coreclr#11577)
* Fix EventPipe initialization.
* rebase code with master, add prototype of event source metadata
* fix define event
* add null ptr checking
* move WriteEvent metadata serialization to managed side
* Fix enabled keywords for COMPlus_PerformanceTracing=1.
* put parameter name into metadata, use WriteToBuffer
* Write event metadata to the file.
* allocate buffer in EventPipeEvent ctor
* prevent double free
* refactor code
* AddEvent params reorder
Commit migrated from https://github.com/dotnet/coreclr/commit/
a7fae647fc09448cce04276a87a2873c09d31d42