Man who stabbed stranger in heart jailed