Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languages