Sort dictionary keys on write to stabilize them, and (in bplist) unique them in k,k,v,v order.
[tests] Update the tests for the new stable key order (and internal dictionary format.)