This scenario is the same as the suicide of the copilot on an Embraer195 in Mozambique last year, I think.
Unfortunately, banging on the door won't help.
The only way would be to smash a window and provoke a decompression.
In that case the door would automatically unlock.
I had raised the suicide issue years ago, because of the stupid door, but nobody would listen....
Terrible news, and it will for sure be even more disgusting after nothing will have changed because it's not feasible to interrupt the cabin service to have a flight attendant in the cockpit when one of the pilots goes to make a phone call....