Top seed Marin Cilic was taken to three sets on his way to a first-round win at the US National Indoor Championships in Memphis.