Tweak migration to merge duplicate hosts in the same workspace

Historically there a few scenarios where a user could end up with Hosts in the same workspace with the same IP. If a user were to run migration 20130430162145, which adds a uniqueness constraint to the workspace_id, host_id index, the migration would fail until the user manually removed the offending hosts. I am updating the migration here to detect duplicate hosts in the same workspace, merge references to these duped hosts in other tables in the DB, and resolve to just one host (the last one added).

### PT #51335651
RM #7988

Verification steps:

1. Download the PG dumps attached to the [PT Ticket](https://www.pivotaltracker.com/story/show/51335651). First let's test against the scenario where the user has duplicate hosts in the same workspace:

        $ rake db:drop; rake db:create; rake db:migrate VERSION=20130430151353
        # Be sure that the DB name used here matches what you have in spec/dummy/config/database.yml
        $ psql metasploit_data_models_development < ~/Downloads/test_uniq_migration.sql

2. Now verify that the correct data is in the database:

        $ cd spec/dummy
        $ rails c
        > Mdm::Host.count #=> 6
        > Mdm::Host.where(:address => '10.6.201.174', :workspace_id => 1).count #=> 3
        > Mdm::Service.count #=> 3
        > exit

3. Now run the migration:

        $ cd ../..
        $ rake db:migrate:up VERSION=20130430162145

4. You should see the message "Duplicate hosts in workspace found. Merging host references." in the console log.
5. Verify that the duped hosts had their data merged:

        $ cd spec/dummy
        $ rails c
        > Mdm::Host.count #=> 4
        > Mdm::Host.where(:address => '10.6.201.174', :workspace_id => 1).count #=> 1
        > Mdm::Client.where(:host_id => Mdm::Host.find_by_address('10.6.201.174').id).count #=> 2
        > Mdm::Event.find_all_by_host_id(Mdm::Host.find_by_address('10.6.201.174').id).length #=> 2
        > Mdm::ExploitAttempt.where(:host_id => Mdm::Host.find_by_address('10.6.201.174').id).count #=> 4
        > Mdm::ExploitedHost.where(:host_id => Mdm::Host.find_by_address('10.6.201.174').id).count #=> 1
        > Mdm::Host.find_by_address('10.6.201.174').host_details.length #=> 1
        > Mdm::Host.find_by_address('10.6.201.174').loots.count #=> 6
        > Mdm::Host.find_by_address('10.6.201.174').notes.count #=> 5
        > Mdm::Host.find_by_address('10.6.201.174').sessions.count #=> 3
        > Mdm::Host.find_by_address('10.6.201.174').services.count #=> 3
        > Mdm::Host.find_by_address('10.6.201.174').tags.count #=> 3
        > Mdm::Host.find_by_address('10.6.201.174').vulns.count #=> 4
        
        
6. Now let's ensure that a db with no duped records is not affected by the fix:

        $ rake db:drop; rake db:create; rake db:migrate VERSION=20130430151353
        $ psql metasploit_data_models_development < ~/Downloads/normal_db.sql
        $ rake db:migrate:up VERSION=20130430162145

7. You should *not* see "Duplicate hosts in workspace found. Merging host references." in the console log