Use HashMap::find_with_or_insert_with in DocumentHelpers::register_named_element (fixes #3193)

Should probably use HashMap::entry() but that doesn't seem to be available with servo's current rust snapshot.

r? @Ms2ger