Fix "Bad file descriptor" and file mode bits in fsu_ecp

When copying (for example) a directory recursively fsu_ecp fails:

    $ ls -la /tmp/dir/
    total 0K
    drwxr-xr-x 2 mato users  80 Oct  9 11:51 .
    drwxrwxrwt 9 root root  280 Oct  9 11:56 ..
    -rw-r--r-- 1 mato users   0 Oct  9 11:51 file1
    -rw-r--r-- 1 mato users   0 Oct  9 11:51 file2
    $ ./fsu_ecp /tmp/fstest.udf -pR /tmp/dir .
    lt-fsu_ecp: write ./dir/file2: Bad file descriptor
    lt-fsu_ecp: write ./dir/file1: Bad file descriptor

This set of commits fixes the above case, improves error reporting in copy_file() and ensures target files are created with the correct permission bits (identical to source).