Made locking and wait / notify part of the TaskStore interface - and implemented methods in both mem store and redis store