Scanning tunneling microscope operating as a spin diode