fix(log): flush logs on process exit.