A second order minimality condition for the Mumford-Shah functional