Elastic interaction and stability of misfitting cuboidal inhomogeneities