Moves code out of the try/catch blocks in the connect() methods.

That code wouldn't throw a PDOException, so having it in the
try/catch block is pointless. Moving it out makes it easier to
read.