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.
1 job for do-no-stat-symlinks in 11 seconds (queued for 2 seconds)