Fix resource leaks
Initialize all fields in events

to make coverity happy
Fix use-after-free complained by coverity

It's not really use-after-use, because the pointer is not dereferenced
Fix a memory leak

Found by coverity
Merge branch 'atronix' into coverity_scan

Conflicts:
	src/os/host-core.c