c api: add max wal total to opts