We should only assign a relay the HSDir flag if it is currently considered valid. We can accomplish this by only considering active relays, and as a consequence of this we also exclude relays that are currently hibernating. Fixes #12573