mavlink: memory leaks on exit fixed, minor fixes