Device wrappers no longer hold reference to platform wrappers

This caused cyclic dependencies between device and platform
wrappers. To get a platform wrapper from a device use
ccl_platform_new_from_device() instead.

This problem was uncovered during the addition of several
ref/unref tests for context, platform and device wrappers in
test_cad_context.c (which are also added in this commit).