How to use the Non Maskable Interrupt on SAM4S?
Atmel SAM4S MPUs feature NVIC interrupt controller that supports only external interrupts to be linked with NMI. You can also trigger it manually, but this won't be of much use to you. 

Solution is to have external circuitry that will trigger the NMI using external interrupt on power failures. 

Note: If I understand your current solution you try to detect falling edges on power line. I am not sure that this will be reliable, or even fast enough (since you have debouncing filter on the input).