libbladeRF, bladeRF-cli: Reworked cal data generation and misc cleanup

The function to create cal data now is a wrapper around
bladerf_alloc_image() which initializes the returned image with
calibration data.

The associated CLI command now allows this to be either written to a
file or to the device directly.

Misc fixes and cleanup are also included.