It's definitely possible to extract keys from memory. Because of how modern systems work, bitcoind's address space (where its keys are stored) is accessible by other processes running as the same user and also by those with higher privilege levels.
The most universal safeguard against these sorts of attacks is to simply "erase" the key by writing over it with random bytes. There's still a window in which this key can be read, but if an attacker is able to read your key from memory there are countless other ways they can get at it.
Depending on what processor you're running, you might also be able to take advantage of hardware features to hide your keys. Many ARM processors specifically have a special execution space called TrustZone that can be used to separate your keys from the main address space. Here's a paper describing such a system applied to bitcoin wallets.
This isn't in your question, but you might be interested to know that you don't necessarily need to store your primary wallet on your computer to begin with; you can easily encrypt and print out your private key, remove all evidence of it from your computer, and still receive/hold funds. Food for thought!