When serializing inventory, pop from the start of the hosts list

Fixes #8646