This patch removes all occurances of with_lockmode("update")
and replaces them with with_for_update(). with_for_update()
does the same thing as with_lockmode("update") (adds FOR
UPDATE to the sql statement).
This patch also addresses the action_acquire issue that can lead to
deadlocks. with_lockmode("update") will lock the entire table
leading up to the matching row when the unique ID of the row
is not specified. action_acquire_first_ready has been updated to
first seach for the unique ID and then lock the single row using
action_acquire.
Change-Id: I2637504c7d294b9993e8c90570974cef8c246fbf