Slowing wage gains restrain US labor costs in second quarter