dict_insert returns -1 if dict not writable