Mechanics of a nanocrystalline coating and grain-size dependence of its plastic strength