_samples: misc style fixups

Signed-off-by: David Aguilar <davvid@gmail.com>
pickler: remove unused import

Signed-off-by: David Aguilar <davvid@gmail.com>
unpickler: use util.itemgetter everywhere

Signed-off-by: David Aguilar <davvid@gmail.com>
unpickler: allow references to objects with custom handlers

The pickler always adds a duplicate reference placeholder for custom
handlers because _mkref() is called twice in the flatten() code path
when objects have custom handlers.

This means we need to keep the same parallel count in the unpickler for
all "py/id" references that use custom handlers.

When the reference points to an object that has a custom handler create
a duplicate entry in the _objs reference list so that it can be
dereferenced.  This makes the unpickler symmetrical so that the
reference IDs properly align.

The classes used in the unit tests were provided by @c0indev3l in the
original issue.

Closes #55

Reported-by: @c0indev3l via github.com
Signed-off-by: David Aguilar <davvid@gmail.com>