mavlink: cleanup and refactoring, rcS: EXIT_ON_END fix