Modifications to os::copy_file()

* Now returns `false` if source and destination are the same.
* Returns `false` if source is a directory.

Fixes #9947