Closed form solution for a nonlocal elastic bar in tension