In preparation for using wait handles in --on-process-exit events, factor wait handles into their own wait handle store. Also switch them to per-process instead of per-job, which is a simplification.