Control of defects during laser surface alloying