Fixes smart_migrate for a TypeError bug

Bug is: TypeError can't convert Rex::RuntimeError into String

[SeeRM: #7984]
Land #1876, @wchen-r7's fix for Redmine 7984