better detection of remote file vs dir (bb #461/ bb #549)

when recursive listing is used and the remote source generates more than one
matches we require the local target to be a dir.

when non-recursive listing is used we omit directory matches
(for example /a/b/? matches /a/b/c/d server-side, but we omit it during
 a non-recursive sxcp/sxrm), and count the remaining files to decide whether
we should require a directory.