Fix a race condition problem

Prevents Model::save() from generating a query with WHERE 1 = 1 on race condition.

Refs #3857
Fix CS
Merge pull request #3959 from chinpei215/master-issue3857-fix

Fix a race condition problem

Fixes #3857