Catch memory allocation failures in WQ.
Also, print debug/error messages where the failures are first caught.
Fix segfault when worker sends an available results message and terminates.
The segfault happens because WQ does not remove the worker from the list of
workers with available results.

To make the removal in O(1) use a hash table instead of a list.
Remove double initialization.