Improve and optimize event wait list handling functions

These functions now return the given event wait list so they can
be used directly in functions which accept event wait lists.