MOTOR-38, fix tests for narrowed localhost exception.

Brief hack while awaiting a PYTHON 714 backport to PyMongo 2.7.x.

(cherry picked from commit d61db44)