Fix crashes in delete_expired and vacuum_storage
Deleting file uploads that are linked to expired artifacts should be fairly uncontroversial, as well as relations whose source is an old incomplete artifact. I considered also deleting relations whose target is an old incomplete artifact, but I can imagine that causing some confusion, so I think it's better to exclude such artifacts from the deletion process.
Fixes: #891 (closed)