config: Add typing info to functions returning SWH interfaces
This should help avoiding implementation mistakes as mypy will now check typing when a client code use these interfaces.
Fix some typing issues that were uncovered by this change.
Related to swh-storage!1135 (merged)