Structural phase stability and elastic properties of refractory carbides