Fix memory management for dispatch queue