Add support for automatic quit when idle for a long time.