Dump user id cache to file + fix threading bug