Small refactoring on close_tab function
Consider saved changes as committed
Always consider stand-alone code as changed