MTP: Use mutex in do_close_write.

We need it!
WIP: Use normal filenames in paths.

It's becoming too fragile to use item IDs as path elements. Beyond
the problems with clients that don't use copy names, there are a
bunch of situtations where a path sent by a client could be an id
or a filename and it's not 100% possible to tell them apart.

When the initial feature set of very limited, this wasn't much
of an issue, but with direct read/write support, we are now
exposed to a huge set of clients (as opposed to just file managers)
with no ability to recognise copy names, and which generate a lot
of mixed form paths, so we're past the tipping point where it's now
less of a hassle to maintain a name to id mapping.