Fix a crash during concurrent sessions TIMEOUT reported by James
Turner (#5).

imsgev_close schedules(event_add) iev and the event struct is free-ed
before the event is dispatched.

Include string.h after recent libressl changes.