You can't. If there is only one windows open it won't be closed if the last tab is closed.

Don't know if there is an extension that allows that.