Bounds check array index. Fixes a crash when len == 1.
Rename to differentiate setup and init operations.
mtype, mpath are accessible to maildrop, simplify setup parameters.
Give session a chance to init its imsgev. Let session initiate the
process of MAILDROP_INIT. Maildrop now sets up itself and waits for
MAILDROP_INIT from session.

This would now eliminate the doubt in the earlier setup when priv
process forks and the child gets cpu slice first before parent which
sends MAILDROP_INIT to an uninitialized imsgev.
No use of iev->data, set it to NULL.
space nit.
Shorten.
Disengaging imsgev is tricky. First imsgev_clear as we know there
isn't anything left to be written. Signal imsgev termination by
setting iev->terminate = 1(Mind that we are setting it from with
the callback). As imsgev would again callback dispatch with
IMSGEV_DONE, we cannot free imsgev yet. So iev_maildrop need to
exist beyond lifetime of session until IMSGEV_DONE. Allocating it
seperately from session.

imsgev_close is avoided as it schedules another EV_WRITE which is
not needed in our case.

This fixes a crash observed consistently with a little perl script
to simulate concurrent sessions. Thanks MALLOC_OPTIONS='SFG<<'
Merge refactor branch.
Merge remote-tracking branch 'upstream/master'

Conflicts:
	pop3d.c