Commit Briefs
reset all the state functions regardless of MB_READ vs. MB_COMPLREAD
must_select otherwise is set when MB_COMPREAD but not cleared on MB_READ, yielding funny errors. While here, move also the other parts of the state out of the if (MB_COMPLREAD) to avoid this kind of issues in the future.
drop the `buffer' flag for enqueue_download
it's unused as write_buffer now writes a buffer to the disk.
fix handle_save_page_path
there's no need to handle the buffer case, which is now handled directly by write_page. While here fix an issue if the open fails: we still need to stop the tab!
unbreak history file
I can't use the ""generate temp file + rename" trick used for the session file, because I only add items that are not "dirty". the history-on-disk things needs some improvements, mostly to limitate the size of the file, but for the time being unbreak it!
generate session/history_file atomically
if an i/o error occurs while writing those files, they may end up being corrupted or truncated. Use the approach already used for tofu, write a temp file and rename(2) it to the correct position.
merge the fs into the ui process
The previous separation between the fs and ui process wasn't that good. The idea was to have a `ui' process tightly sandboxed, but it was a lie actually. `ui' was one imsg away from making internet connections and accessing data on the disk, so it wasn't really limited in (almost) any way. Furthermore, having to serialize data to/from the fs proc started to become not really maneagable. As a first step to fix this situation, join the fs and ui process.