Probing entanglement in adiabatic quantum optimization with trapped ions