lib/repo: Port tmpdir locking func to new style
lib/repo: Port tmpdir locking func to new style

Prep for future work.

Closes: #1168
Approved by: jlebon

GNOME/ostree,GNOME/ostree,GNOME/ostree,GNOME/ostree,GNOME/ostree