Finish main activity when close the last tab.