Make sure previous.overlay is defined before using it

In the case where an overlay doesn't completely load before the
user hits the back button, it would throw a JS error. This prevents
the error.

Change-Id: I00e37f99b32a15dc79a0d9c11ab485e33137bd6c
Merge "Make sure previous.overlay is defined before using it"