Charge and spin transport in a metal-semiconductor heterostructure with double Schottky barriers