Fix caching friends_ids

"res" was modified, and cache_data corrupted because of that