Give event_assign a return value, and make it less inclined to exit(). We also refactor event_assign so that it is the core function, and event_set() is only the wrapper. svn:r1469