[client] refactor: extract common from seaf_download and seaf_sync + allow user to specify not only library id, but library url