This may be of help to 3rd party plugin developers (maybe I should post this in the developers section):
"all methods returning metadb_handle return add_ref'd handles, you have to handle_release them"
This is a code comment in the SDK code which I only recently spotted (RTFM syndrome

). I simply added handle->release() where appropriate and the problem was immediately gone from my plugin.