[RFC] job: Add optional {flags} parameter.

fixes #1574
Macro `push_job_event` has a return statement. So it could be possible that the statement `free(data);` would not be reached.