Erel,
Can you run the code attached on your Nexus 5 running Android L and let me know what happens. (it's basically the code you posted above)
On my Nexus 5 running Android L this is what happens..
Load app, and runs fine
Press the back button and a message comes up saying do I want to close the app with a Yes, No buttons
I press No, and the app stays open. (which is fine)
I press the back key again
Press the back button and a message comes up saying do I want to close the app with a Yes, No buttons
I press Yes this time
App still says open, doesn't close. (app should of closed, but doesn't)
Everytime I press the back key it logs -3 in the IDE log.
Are you able to upload a sample project that is working on your device so I can test it on mine since I can't get it to work?