T-API: fixed UMat sync problems

Test that shows the problem:
```
TEST(UMat, Sync)
{
    UMat um(10, 10, CV_8UC1);

    {
        Mat m = um.getMat(ACCESS_WRITE);
        m.setTo(cv::Scalar::all(17));
    }

    um.setTo(cv::Scalar::all(19));

    EXPECT_EQ(19, cv::norm(um.getMat(ACCESS_READ), cv::NORM_INF));
    EXPECT_EQ(19 * um.total(), cv::norm(um.getMat(ACCESS_READ), cv::NORM_L1));
}
```