Device for converting rotary to linear motion