lib: Add istream-try This can be used to automatically detect the underlying istream format from a given list of choices.