Stop FUSE sessions properly

Now when we call ExternalStorageService#onEndSession
we block to ensure the FUSE loop has exited. This allows
us avoid racing mount and unmount events.

Typical usage: Vold#unmount -> ExternalStorageService#waitForExit

We don't use fuse_session_exit provided by libfuse because it needs
to be called from a signal handler or a FUSE operation handler.
Those are the only ways the loop can break out of a blocking read(2)
to accept the set 'exit' flag.

Test: atest AdoptableHostTest
Bug: 142109745

Change-Id: Ib0d525792eecd813ed4c7c30db5cb9d3053668c0
6 files changed