Improved error handling for repack_table_indexes()

If we do not successfully build any indexes on the target table, bail out
early instead of acquiring an ACCESS EXCLUSIVE lock on the table.