HPCC-9904 - ensure detach checks if allowed to delete file

Regression introduced by HPCC-8364, allowed logical files to be
deleted by various components (e.g. thor writing to a file) even
if logical file was owned by a superfile.

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Merge pull request #4797 from jakesmith/hpcc-9904

HPCC-9904 - ensure detach checks if allowed to delete file

Reviewed-By: Gavin Halliday <gavin.halliday@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>