Add a define for the case the the PID file is already acquired
Make config value string type non-const

The string value is allocated and has to be freed.
base58: Cleanup variable name
daemon: Introduce defines for magic status numbers

Also close PID file and log file in case daemonization didn't work.