fix unlock shared memory if could not allocate memory for worker message