Refactor the behavior of quiting if no more normal window

Only take action when we are in NERDTree window, and no more
window with normal buffer open.

Before quitting Vim, delete the buffer so that the '0 mark
is correctly set to the previous buffer. This avoids NERDTree
buffer being the last displayed buffer if Vim fails to quit
due to the last file in the argument list has not been edited
yet.

Then quit as usual, we have autocmd nesting open, so the 'quit'
will trigger other plugin window's quiting behavior. If we are
quiting Vim, our current buffer is successfully reset to the
last file buffer, no need to warry about failure.
Close the tab page if more than one open instead of quiting vim