Fix for issue #2374 (INSERT .. RETURNING always returns null for dynamically created tables)