An Accrington drug dealer who sold cocaine in order to fund his own habit has avoided an immediate prison sentence.