[DBAgent] Add a new virtual method: lastUpsertDidUpdate().

This patch adds a method that tells whether the previous upsert results in update or insert.