Relaxation of bosons in one dimension and the onset of dimensional crossover