NHL ends stalemate with lockout deal