Buckling of a thin elastic rod inside a horizontal cylindrical constraint