Nomatter the firmware, all hardware will act weird during spikes, powerouts and brownouts - Hence really hard to test for and safeguard against, for consumer hardware (expensive). How "it" acts depends on capacitor discharge time, internal hardware layout, etc..
Get a small UPS and be done with...