Close prepared statement in sql-str and run-copy