add bear prefix to perror messages
fix temporary socket dir problem
use config.h macros