Stability of compressed sensing for dictionaries and almost sure convergence rate for the Kaczmarz algorithm