device: use g_hash_table_replace instead of insert function