mlock, like VirtualLock, doesn't guarantee that a copy won't go out to disk, only that a copy will always be in RAM.
The notes section of the page I linked addresses this - it'll only be paged in a hibernate state where memory is powered down. It won't be paged without that.
That's just one of many examples.
For instance if you're running in a VM, all bets are off, beacuse the host can and will page you out guest phys memory.