make the window close event sync instead of async

@financeCoding 

Adam, I have one more bug fix I want to try and get in, then perhaps we kick out a new version?