Fix a bug that could cause webdriverjs to get stuck in an infinite loop if there's an uncaught exception.
Check path suffix, not prefix.