Add validation to ensure we don't mv a file onto itself

Fixes #831.

cc @danielgtaylor