Fix app not closing on Mac after windows are closed