<!-- Describe the issue -->

When trying to sign a transaction in a encrypted wallet that is locked, version 0.16 would return the following error:

```"Please enter the wallet passphrase with walletpassphrase first."```

While doing exactly the same procedure against 0.17, the response is something like:

```json
"hex": "020000000183ac9cc1137c444f32356fb070ecba194c87a05e43674c06a55f5b1d0561eabc0000000000ffffffff0180626a94000000001600141875aa6ab19c2551c11759cf3e9f4dd7aa40bcf500000000",
       "complete": false,
       "errors": [
         {
           "txid": "bcea61051d5b5fa5064c67435ea0874c19baec70b06f35324f447c13c19cac83",
           "vout": 0,
           "witness": [
           ],
           "scriptSig": "",
           "sequence": 4294967295,
           "error": "Unable to sign input, invalid stack size (possibly missing key)"
         }
     ]

```

<!--- What behavior did you expect? -->

v0.17 should check if the wallet is locked before trying to sign the tx and return the same error as v0.16 for consistency reasons.
"3. include_watchonly (bool, optional, default=false) Also include balance in watch-only addresses (see 'importaddress')\n"
            "\nResult:\n"
            "amount              (numeric) The total amount in " + CURRENCY_UNIT + " received for this wallet.\n"
            "\nExamples:\n"
            "\nThe total amount in the wallet with 1 or more confirmations\n"
            + HelpExampleCli("getbalance", "") +
            "\nThe total amount in the wallet at least 6 blocks confirmed\n"
            + HelpExampleCli("getbalance", "\"*\" 6") +
            "\nAs a json rpc call\n"
            + HelpExampleRpc("getbalance", "\"*\", 6")
        );
    
    
    pwallet->BlockUntilSyncedToCurrentChain();
    LOCK2(cs_main, pwallet->cs_wallet);
    const UniValue& dummy_value = request.params[0];
    if (!dummy_value.isNull() && dummy_value.get_str() != "*") {
        throw JSONRPCError(RPC_METHOD_DEPRECATED, "dummy first argument must be excluded or set to \"*\".");
    }
    int min_depth = 0;
    if (!request.params[1].isNull()) {
        min_depth = request.params[1].get_int();
    }
    isminefilter filter = ISMINE_SPENDABLE;
    if (!request.params[2].isNull() && request.params[2].get_bool()) {
        filter = filter | ISMINE_WATCH_ONLY;
    }
    return ValueFromAmount(pwallet->GetBalance(filter, min_depth));
}
static UniValue getunconfirmedbalance(const JSONRPCRequest &request)