Factored device title printing code out into pv::DeviceManager::format_device_title

This fixes the earlier bug where pv::DeviceManager::compare_devices
would crash if any of the device string fields were NULL.