ART: Destroy unprocessed tasks in TaskProcessor.

In the past I've seen valgrind complain about leaked tasks
in the TaskProcessor, so make sure we clean up properly.
Also hold the mutex and condition variable directly in the
object instead of allocating separate objects on the heap.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: If0d4ac39bf3d8e2aa9b465186d4fa7c3cb746718
diff --git a/runtime/gc/task_processor.h b/runtime/gc/task_processor.h
index e40fa06..f6b5607 100644
--- a/runtime/gc/task_processor.h
+++ b/runtime/gc/task_processor.h
@@ -54,17 +54,17 @@
  public:
   TaskProcessor();
   virtual ~TaskProcessor();
-  void AddTask(Thread* self, HeapTask* task) REQUIRES(!*lock_);
-  HeapTask* GetTask(Thread* self) REQUIRES(!*lock_);
-  void Start(Thread* self) REQUIRES(!*lock_);
+  void AddTask(Thread* self, HeapTask* task) REQUIRES(!lock_);
+  HeapTask* GetTask(Thread* self) REQUIRES(!lock_);
+  void Start(Thread* self) REQUIRES(!lock_);
   // Stop tells the RunAllTasks to finish up the remaining tasks as soon as
   // possible then return.
-  void Stop(Thread* self) REQUIRES(!*lock_);
-  void RunAllTasks(Thread* self) REQUIRES(!*lock_);
-  bool IsRunning() const REQUIRES(!*lock_);
+  void Stop(Thread* self) REQUIRES(!lock_);
+  void RunAllTasks(Thread* self) REQUIRES(!lock_);
+  bool IsRunning() const REQUIRES(!lock_);
   void UpdateTargetRunTime(Thread* self, HeapTask* target_time, uint64_t new_target_time)
-      REQUIRES(!*lock_);
-  Thread* GetRunningThread() const REQUIRES(!*lock_);
+      REQUIRES(!lock_);
+  Thread* GetRunningThread() const REQUIRES(!lock_);
 
  private:
   class CompareByTargetRunTime {
@@ -74,9 +74,9 @@
     }
   };
 
-  mutable Mutex* lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
+  mutable Mutex lock_ DEFAULT_MUTEX_ACQUIRED_AFTER;
+  ConditionVariable cond_ GUARDED_BY(lock_);
   bool is_running_ GUARDED_BY(lock_);
-  std::unique_ptr<ConditionVariable> cond_ GUARDED_BY(lock_);
   std::multiset<HeapTask*, CompareByTargetRunTime> tasks_ GUARDED_BY(lock_);
   Thread* running_thread_ GUARDED_BY(lock_);