Optimal preconditioning for the symmetric and nonsymmetric coupling of adaptive finite elements and boundary elements