Bug TW-1288

- TW-1288 Added missing locking for task modifications (thanks to Kosta H,
          Ralph Bean, Adam Coddington).