py3: convert filtername to str if it's None

Authored by pulkit.

Description

py3: convert filtername to str if it's None

I have not called pycompat.bytestr() and rather converted the value there
because I am starting to get concerned about the function call overhead of all
this bytes to str or vice versa convert functions.

Differential Revision: https://phab.mercurial-scm.org/D6042

Details

There are a handful of other places in branchmap and elsewhere that also log or format repo.filtername.