<!-- Describe the issue -->
<!--- What behavior did you expect? -->

<!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

<!--- How reliably can you reproduce the issue, what are the steps to do so? -->

<!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

<!-- Any extra information that might be useful in the debugging process. -->
<!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

I'm writing a quick release note for #14494 (Error if # is used in rpcpassword in conf) and it doesn't work the way I expect with the optional new configuration file style.  For example, this configuration file aborts startup as expected:

```text
$ cat .bitcoin/bitcoin.conf ; bitcoind -testnet | tee /dev/null | head -n 5
rpcpassword=foo#bar
Error reading configuration file: parse error on line 1, using # in rpcpassword can be ambiguous and should be avoided
```

However, this does not:

```text
harding@redspot:~$ cat .bitcoin/bitcoin.conf ; bitcoind -testnet | tee /dev/null | head -n 5
[test]
rpcpassword=foo#bar
2019-01-01T20:24:25Z Bitcoin Core version v0.17.99.0-f5a70d1462 (release build)
2019-01-01T20:24:25Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1
2019-01-01T20:24:25Z Assuming ancestors of block 0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75 have valid signatures.
2019-01-01T20:24:25Z Setting nMinimumChainWork=00000000000000000000000000000000000000000000007dbe94253893cbd463
2019-01-01T20:24:25Z Using the 'sse4(1way),sse41(4way)' SHA256 implementation
```

The same problem with rpcpassword applies to the `[main]` section. I can confirm that options specified in sections are otherwise working correctly here, and that rpcpassword also otherwise works as expected---I only fail to get the expected error when putting it in a section.

I'm running commit f5a70d1462592a23bbad4aa150e6b2beaeec7c42 (master from 2019-01-01) on Debian Stable on x86_64.

CC: @MeshCollider (author of #14494) 
#endif
#include <codecvt>
#include <io.h> 
#include <shellapi.h>
#include <shlobj.h>
#endif
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif
#ifdef HAVE_MALLOPT_ARENA_MAX
#include <malloc.h>
#endif
#include <openssl/crypto.h>
#include <openssl/rand.h>
#include <openssl/conf.h>
#include <thread>
const int64_t nStartupTime = GetTime();
const char * const BITCOIN_CONF_FILENAME = "bitcoin.conf";
const char * const BITCOIN_PID_FILENAME = "bitcoind.pid";
ArgsManager gArgs;
static std::unique_ptr<CCriticalSection[]> ppmutexOpenSSL;
void locking_callback(int mode, int i, const char* file, int line) NO_THREAD_SAFETY_ANALYSIS
{
    if (mode & CRYPTO_LOCK) {
        ENTER_CRITICAL_SECTION(ppmutexOpenSSL[i]);
    } else {
        LEAVE_CRITICAL_SECTION(ppmutexOpenSSL[i]);
    }
}
class CInit