When downloading and running Bitcoin core for the first time, after clicking through the "Are you sure you want to open. it?" screen, there's a possibility that macOS will pass an argument like `-psn_0_SOME_ID` to the application, which results in a shutdown as it's an invalid argument:

![v0 19 0rc1 args shutdown](https://user-images.githubusercontent.com/863730/67034964-b026fc00-f0e6-11e9-8462-70d0fcf613e6.png)

This only happens on the first run, subsequent opens will work fine, but we should filter these out, otherwise it's a poor and confusing first experience.

{
    LOCK(cs_args);
    const bool fRegTest = ArgsManagerHelper::GetNetBoolArg(*this, "-regtest");
    const bool fTestNet = ArgsManagerHelper::GetNetBoolArg(*this, "-testnet");
    const bool is_chain_arg_set = IsArgSet("-chain");
    if ((int)is_chain_arg_set + (int)fRegTest + (int)fTestNet > 1) {
        throw std::runtime_error("Invalid combination of -regtest, -testnet and -chain. Can use at most one.");
    }
    if (fRegTest)
        return CBaseChainParams::REGTEST;
    if (fTestNet)
        return CBaseChainParams::TESTNET;
    return GetArg("-chain", CBaseChainParams::MAIN);
}
bool RenameOver(fs::path src, fs::path dest)
{
#ifdef WIN32
    return MoveFileExW(src.wstring().c_str(), dest.wstring().c_str(),
                       MOVEFILE_REPLACE_EXISTING) != 0;
#else
    int rc = std::rename(src.string().c_str(), dest.string().c_str());
    return (rc == 0);
#endif 
}
/**
 * Ignores exceptions thrown by Boost's create_directories if the requested directory exists.
 * Specifically handles case where path p exists, but it wasn't possible for the user to
 * write to the parent directory.
 */
bool TryCreateDirectories(const fs::path& p)