Fix EZP-21057: [contentService] Unable to delete a content with an empty file attribute

Updated PR #408 to include integration test and fix for comment by @bdunogier, but kept the old checks as well to make sure the functions themselves are not risky to be called on their own.