shm: add safety assertions

Catch any API mis-use with an assert. This should abort when the
user calls unreferences the pool more times than it's referenced.

Also change the refcount check to explicitly check for positive
counts.

Signed-off-by: Simon Ser <contact@emersion.fr>
3 jobs for shm-buffer-ref-assert in 1 minute and 6 seconds (queued for 1 second)
latest
Status Job ID Name Coverage
  Review
passed #10374149
check-commit

00:00:13

 
  Prep
passed #10374150
debian:buster@container-prep

00:00:20

 
  Build
passed #10374151
build-native

00:00:31