Merge "Save before action" dialogs into CheckForSave (reduce code duplication)

Based on TortoiseSVN revision 24073

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>