Mercury stabilization using thiosulfate and thioselenate