attachment: Support Windows paths when taking basename of client-supplied file name.