Add opentracing type stubs and fix associated mypy errors.