Multithread-proof check on Queue

Added multithread-proof clear(self) in Queue module.