Local Malliavin calculus for Lévy processes and applications