Optical spin-to-orbital angular momentum conversion in inhomogeneous anisotropic media