Test case for an aspect of Redmine 6027

If create, depth_search and copy_from attributes are mixed in a
promise, then a file is created unless explicitly marked as a
directory via trailing "/.".
Minor cleanups.

Declare fd when it's needed, and move comment into right location.
Remove comment that adds no value.
Assume promiser is a directory if depth_search is set

depth_search only makes sense if the promiser should be a directory
that might be copied from a remote server. So make sure we execute
the same code as if the policy writer expliclty asked for the promiser
to be created as a directory by suffixing with "/.".

Attempt to fix various redmine tickets reporting that copy_from
promises for remote directories create local files. Assumption is
that network interruption aborts transmission of data that tells
client that remote sources are a directory tree, and lacking the
'/.' in the promiser the client defaults to file creation.

Redmine #3400, 6027
Merge pull request #1991 from vohi/redmine/6027

Redmine/6027