Buckling-induced dislocation emission in thin films on substrates