Making it so that for both these cases

 * popup passed through constructor
 * popup set later

we are binding on beforeunload