Appeals court upholds state's ballast water rules