[FLINK-1152] More robust resource release when tasks are canceled during deployment