I've seen people at the gym who look like they're holding on to the treadmill's siderails for dear life. There are a couple of problems with holding on to the rails. First, it forces you to hunch over, an inefficient running form that can lead to neck, shoulder, and back pain. Keep your posture straight and erect. Your head should be up, your back straight, and shoulders level.
Holding on to the rails may make you feel like you can keep up the pace and work harder, but, in reality, you're reducing your load and making it easier on yourself. Try to pretend that the rails are not even there, as if you're running outside. If you're concerned about falling, you're probably running at too fast of a pace or too much of an incline.
More: Proper Upper Body Form When Running