fixing memory leak in MIDIEventCreate.

event is allocated memory which is not freed if malloc for buffer fails.