Typicalness-Aware Learning for Failure Detection