Prevent file deletions when the build output-path is a parent directory

Prevent self trolling when the build output path is a parent directory 

Fixes #1716