stereo: Factor out utility for creating dir from prefix