Refactoring and bug-fixes in src/server/module.c.
Refactoring and bug-fixes in src/server/module.c.

* We don't need to check if exec failed in module.c if it returns an
error has taken place, so we can just log the error and exit.

* break load_output_module up with helper functions
- start_module after fork sets up file descriptors and execs the
appropriate module
- send_initial_commands send the initial init audio log_level commands
to the new module
- We create a create_module function which does the reverse of the
destroy_module function, given parameters it allocates and copies the
needed strings to create the module struct.

* if either pipe() call at line 88 of src/server/module.c failed we
would fail to create the module, and return NULL, but we didn't free the
memory allocated for that modules struct.  This is fixed by calling
destroy_module() if pipe() fails.

* two variables in the load_output_module function are not needed
- cfg this is just a flag which duplicates wheither or not we have a
config file name
- arg1 passed to exec as the config file name, since it was strduped it
  complicated the memory management and added nothing since it was
equivelent to module->configfilename

* rename the int fr variable that was the return from fork to the more
descriptive pid
* change the switch to a if, else if, else
* make sure all negative returns from fork are considered failures
* change a printf to use MSG

* if fork failed in load_output_module() we returned null but didn't
free the memory associated with the module's struct.  Fix this by
calling destroy_module if fork fails.

*  log if waitpid returns an error, or returns a incorrect pid, and
reindent module.c
* turn down the importance of a log message from warning to notice

* if a module failed to communicate on startup it wasn'tkilled,
and the data associated with it wasn't freed.  Call output_close to do
this.

Note from Chris: this commit was originally a series of 13 patches.

Signed-off-by: Christopher Brannon <12dbcddb2a34235e759e3c56208f0d4ec028c34a@gmail.com>

razr/opentts,razr/opentts,razr/opentts,razr/opentts