osmo_select_shutdown_request(): allow finishing pending writes on SIGTERM

Allow telling osmo_select_main* to only service pending writes (shutdown
mode). Introduce API fuctions to indicate a shutdown request, and find
out whether shutdown is complete.

Some osmo programs have a curious sleep of few seconds upon receiving
SIGTERM. The idea presumably was to finish off pending writes before
halting the program. But a sleep() on program exit is annoying,
especially when there usually are no pending writes, and when osmo-bsc
is launched numerous times for tests.

Change-Id: Ib94d4316924103459577087c2214188679db2227
diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h
index b410199..e9f19a5 100644
--- a/include/osmocom/core/select.h
+++ b/include/osmocom/core/select.h
@@ -105,5 +105,8 @@
 struct osmo_signalfd *
 osmo_signalfd_setup(void *ctx, sigset_t set, osmo_signalfd_cb *cb, void *data);
 
+void osmo_select_shutdown_request();
+int osmo_select_shutdown_requested();
+bool osmo_select_shutdown_done();
 
 /*! @} */