[scripts] improved upgrade shell scripts

1) update the "seafile-server-latest" symlink when upgrading
2) Improved the scripts with the online static checker http://www.shellcheck.net/