context: ENG-2139
Introduced scheduleOrRunCancellable which will allow scheduling a task from the synchronous call that could be canceled while atomic flag in database singleton tasksCancelled will be set to true.
Using the error message as constant TASK_CANCELLED not a meaningful string because later in javascript we will need to indicate an error only by detecting if its message is equal to a given string or contain a given string.