Fixed a bug in memory queue where jobs would be requeued in the same
event loop, causing an attempt to assign the same job multiple times
during a single flush