Revert "Fix a crash when we can't connect to PG"

This reverts commit b6deb6a342451e3628f5093bf1a3254500cc7ca3.
Fix a crash when we can't connect to PG, again
Fix a crash when msfconsole is a symlink
Land #3681, restore rake and rspec functionality

Since this is a more complete fix than #3678 and #3679, this merge
closes #3678 and closes #3679. Lets see if that magic syntax works!