Bug 1024863 - Safeguard against potential race condition

https://bugzilla.mozilla.org/show_bug.cgi?id=1024863