Make check_snapshot ensure snapshot object references exist
When asserting the snapshot is the one expected, this now checks the references
targeted by the snapshot do exist as well.
This also checks that the alias present in the snapshot actually target
branches in the snapshot.
For now, those checks concern only release and revision objects (it does not
check up to directories and contents yet).
The function still allows to declare that some branches can be empty. Like for
example the "evaluation" branch in the case of the nixguix loader.
Related to T2483