sort keys to ensure determinist results

Since perl 5.18, hashes keys order is randomized, leading to different
elements order each time the agent is executed.