Investigation of electron-distribution function and dynamo mechanisms in a reversed-field pinch by analysis of hydrogen-pellet deflection