Inelastic vibrational bulk and surface losses of swift electrons in ionic nanostructures