The stability of ultrathin metal films on W(110) and W(111)