[#2207] Moved misplaced code into for loop body

STACK Output:
bug: anti-simplify
model: |
  %cmp470 = icmp ne i32 %i.1, %sub469, !dbg !11719
  -->  true
stack:
  - /home/kellerb/software/root-stack/irods/plugins/database/postgres/../src/db_plugin.cpp:6628:0
ncore: 1
core:
  - /home/kellerb/software/root-stack/irods/plugins/database/postgres/../src/db_plugin.cpp:6628:0
    - signed subtraction overflow