The temporary data dir is not necessarily located in /tmp, it depends on the OS and access permissions.
Checking for _datadir.startswith("/tmp") caused the tests to fail on systems with the tmp dir in /var/tmp.
Also move the filesystem operations out of start/stop_ec_daemon, so that it becomes more clear that the function creating the directory is responsible for it's deletion, and that no intermediate operation is done to mutate the path (clarifies that we don't delete something else than the tmp directory).
Also remove some assertions that _datadir is not None after _datadir = tempfile.mkdtemp(), because mkdtemp never returns None, it errors on failure. Keep an assertion in start_ec_daemon to make it clear that this need to be called after make_electrum_data_dir