Ensure cursors opened in migrate management command are explicitly closed
Ensure RawQuerySet closes the cursor opened on the RawQuery.
SQLCompilers should close any cursors that they open.

Updated SQLUpdateCompiler.execute_sql to match the behavior described in
the docstring; the 'first non-empty query' will now include all queries,
not just the main and first related update.