Add new WorkflowInstanceDao.updateNotRunningWorkflowInstance method that only updates workflow state when it is safe to do so and make rest api use that. Executor will use the old method that allows updating more fields and works only if the worklow is assigned to the workflow executor