defer @queue.close to non-trap context