add checking if Object.prototype.watch is exist

Object.prototype.watch function is used in model unit test to check a
collision of a record's id with object function's name.
So we create this function if needed and remove after test if it was
not defined before.