Fix: add missing buffer registry cleanup on error

Fixes #542

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: remove one too many metadata refcount increment

Signed-off-by: David Goulet <dgoulet@efficios.com>