Check that a file belongs to the package before removing it