Fixed issue #2127: After delete last tag in Browse references, tree of refs disappeared

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
Prevent from using invalid handle

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
Fix no failure buttons in progress dialog when switch fails

Fix regression of 0e6009e30fa3fb4ce6d8789b0987fa3e9dbd22cb

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