NEXUS-6156: Deleted files left after optimize

Squashed and backported to Nexus 2.7.x

Original PR
https://github.com/sonatype/nexus-oss/pull/278

Commits
b1a1d5e9f18a1297b462d1d2061944370cea3770
934c1f00789195cdf0011be3640fae453f6f8f2c
Merge pull request #306 from sonatype/NEXUS-6156-deleted-files-backport27x

[2.7] NEXUS-6156: Deleted files left after optimize