memcpy() with a NULL pointer is undefined even when the length is 0, and
UBSan reports it as "null pointer passed as argument 2". Skip the copy
when there is nothing to copy:
- Store v2 flusher: a zero-length small write has no checksums, so
get_checksums() returns NULL when compaction merges them
- Store v2 list_objects(): the unstable or the tombstone list is NULL
when only the other one is non-empty
- OSD sync with immediate_commit != all: a dirty PG without copies to
delete after sync has an empty vector whose data() is NULL, while
another PG has some
- disk mock: an empty iovec of a write may have a NULL iov_base
Found by test_pg_chaos --seed 18, test_blockstore and test_heap built
with WITH_UBSAN=yes.