auto replace file path in cflags and ldflags for cgo building.

added func to kill workers