functions: reduce needless invocation of stat in add_file and add_binary
Running too many `stat`s may cause a slowdown. * For `add_file`, do not run `stat` on symlinks. The value will never be used. Instead run it only before copying the file. * For `add_binary`, the file mode returned by `stat` is only passed to `add_file`. Since `add_file` will run `stat` itself, there is no need to do it twice.