mavlink connection sharing bug fix.
updated logic to release unused api handles.