Support graceful shutdown

It requires groonga 3.0.5 and rroonga 3.0.3. They are not released
yet.