osmo-gapk: create a common shutdown function

Previously the code intended to shutdown the osmo-gapk application
was repeated two times. It's better to have a single function.
1 file changed