Fixed #938: closing the last tab will layout immediately

TBR @devoncarew
cc @ussuri