Taiwan courts security ties with bigger friends as Beijing snatches allies