avoid to change the table name in the database if it's already changed
fixed condition when renaming table
added flag comment fixes #1192
Merge pull request #1195 from CartoDB/1192-ghost_table_rename_fails

ghost table rename fails, closes #1192