Fix Threshold layer

Fixing layer_factory to enable use of Threshold layer from proto files. Same fix need to be done in master.