tests: Fix support of Dulwich < 0.20
It expects the path to be a string rather than a pathlib object.
Dulwich 0.19 is in Debian buster so we need to support it.