Test lifetime handling of StoredValue.