Removes the first event record on output buffer. If a fatal error occurs during flush, application should remove the relevant event by using this function. If ev argument is not NULL, the event is created using snd_seq_create_event and its pointer is stored on ev. The returned event should be freed using snd_seq_free_event. If ev is NULL, the removed event is lost.
Function returns zero if an event is successfully removed. Otherwise a negative error code is returned.