add ec_file:is_dir/1

use ec_file:is_dir/1 to identify symlinks which are directories
Ensure contents of symlinked directories are copied when using ec_file:copy/3

This is a pre-requisite of https://github.com/erlware/relx/pull/208