A robust second-order low-rank BUG integrator based on the midpoint rule