mkdb: use six for python2/3 compat