Rewrite cartodb:test:prepare to avoid the bogus db:prepare

Fixes #331
Added fix about GDAL version
Recover from Table.save errors when registering ghost tables through the rake task
Merge branch 'register_ghost_tables' into CDB-1387