libfmq: Fix from_raw_parts UB when used with empty vectors

`std::slice::from_raw_parts` has undefined behavior when called
with a null pointer and a zero length. This may be the case when the
descriptor vectors are empty as `data()` may return a null pointer.

Add and use a `slice_from_raw_parts_or_empty` function that returns an
empty slice in this case.

Test: atest --host libfmq_rust_unit_test
Change-Id: I4400939879f224c071d41ad646b036cf77b41df4
2 files changed