cpp: PixelBuffer requires boost::variant for managed and unmanaged buffers

Boost.MultiArray doesn't use virtual methods and so is not dynamically
castable, so can't be stored properly in a shared_ptr.  Using
Boost.Variant works around this design limitation.  Update array() to
return a reference to multi_array_ref for generality.