When piping the output of a program into lnav, the data would
be dumped to the terminal on exit so that it would not be
lost. Since that is a bit noisy, the temp file used to store
the data is now left in .lnav so that it can be reopened later.
Older stdin captures are automatically removed after a day.
Also took the opportunity to start using filesystem::path more.
Fixes#436
Unused-result from sensitive APIs, printf/scanf formatting types, set
but never used variables, and uninitialized variables.
Also there's one select(enum) that doesn't cover all cases.
Seems like timeval is defined differently on OS X than on Linux. So
fixing the format specifier on one breaks it on the other. Explicitly
cast the value being passed in to fix the problem on both the platforms.