Checks if the given is still valid (could be invalid because of deletion).
Warning: This function is slow. Only use it for debugging and/or testing purposes.