Tamari's Moebius function and free magmatic algebras