source3: move lib/substitute.c functions out of proto.h