More graceful shutdowns even in cgo routines