Cohesive and magnetic properties of Ni, Co, and Fe on W(100), (110), and (111) surfaces: A first-principles study