Deleted references cannot be used anymore

Disallow to access a reference that was deleted using the destroy()
method.
Fix return value of Reference::wasDeleted()
Add Repository::reopen()