Use of tightdb::TableRef improved in various places

The general pattern of these changes are:

- When there is already a "stable" owner of the table accessor such as in the case of `objectSchema->_table`, avoid copying the TableRef. It is more efficient to create a `&` reference, which, in terms of efficiency, is like copying a plain pointer. In these cases, for syntactical reasons, it is more convenient to use `&` references than actual pointers.

- When making a copy of a TableRef object from a named variable `t`, and `t` is not used after that point, use `move(t)`, because that is more efficient (move semantics).