Improve start/stop command output for crashed nodes

When stopping a node that was crashed, moved the informational
message to be displayed before doing the crash report because it can
take a while to complete (and not seeing any output during that time
is not helpful to the user).  When starting a node that was crashed,
changed the message to indicate that the node was crashed (doing
the crash report can take a while, so the new message helps the
user understand what's happening).

Also added a test for stopping a node that crashes during shutdown.
Fix start helper script to return nonzero on error

Fixed the start helper script to return nonzero when it gets a PID
value of -1 from the run-bro script, which indicates that an error
occurred before attempting to execute Bro.  Previously when this
happened, the start helper would return 0 (indicating success), and
broctl would show a "bro still initializing" message, which doesn't
make sense.
Prevent bad plugin from crashing broctl

Catch an exception that is raised when loading a plugin that does not
override all required methods, and output an error message.
Show error if no lb_procs, and disable unused pf_ring plugin

Disable the pf_ring plugin (i.e., return False from its init() method)
if it does not set any environment variables.
If lb_method is specified without lb_procs, then show error message.
Prevent infinite loop in start helper script

The start helper script gets stuck in an infinite loop (which causes
broctl to hang) if it cannot execute the run-bro script.  Added a
check if that script exists (and is executable), and exit with error
if not.
Simplify code that execs commands locally

Removed the captureCmd function (which could cause broctl to hang
due to filling the OS pipe buffer, although this doesn't actually
happen with any of the current uses of this function), and use runLocalCmd
instead.  This allows removal of some code in the popen wrapper function.
Fix use of memlimit broctl option

Fixed a typo in the run-bro script that was causing the memlimit option
to be ignored (the ulimit commands in run-bro were not setting anything
because LIMIT was an empty string).

Added another ulimit command to show the new limits for debugging
purposes.

Also added a test to verify that memlimit is not being ignored.
Prevent broctl from hanging if a host is disconnected

Added ssh options ServerAliveInterval and ServerAliveCountMax so that
broctl doesn't hang when a remote host becomes disconnected from
the network while an ssh session is open.
Improve handling of dead hosts and closed connections

After each broctl command finishes, remove closed connections from the
list of connections and remove all hosts in the dead hosts list (then
broctl will automatically try to reestablish those connections when the
next broctl command runs rather than the user having to exit and rerun
broctl).  This change has no effect when broctl runs only a single command.

Also, fixed a problem where redundant "connection broke" or "not alive"
messages would appear by only reporting the first time (for each run
of a single command) such an event occurs.
Change broctl check command output to be more specific

Changed the output of the check command to be more specific about
what it is actually checking (the existing message "worker-1 is ok"
could be misleading if we cannot even connect to the worker-1 host).
Fix a failing test on FreeBSD 10
Better error handling for "check" and "scripts" commands

Improved the "check" and "scripts" commands to report a single error
message (instead of multiple confusing messages) when a user forgets to
first do an "install".  Updated documentation of "check" command to
remove a statement about check being the only command that works without
first doing an install.

Also fixed exit status to be non-zero when the check or scripts commands
fail to create or remove tmp directory.
Better error handling for broctl cron command

Added an error message if someone tries to run broctl cron without
first doing an install (in order to avoid running scripts with undefined
variables which could have bad side effects).
Better error handling for broctl df command

Added output of error message when df helper fails.  Added error check
to df helper for when broctl install needs to be run.
Better error handling for broctl process command

Improve error output when broctl install has not been run yet.
Reduce the risk of losing track of state info

Changed the way broctl updates PIDs and crash flags by writing the new
values to disk immediately, one at a time, as soon as each new value is
available.  This reduces the chance of losing track of that info if
broctl is killed or terminated before a command finishes.

Also changed the way that the state file is updated when each command
finishes by doing the update as an atomic operation, so that even in the
worst case (broctl is killed or terminated while updating that file) we
never lose existing entries.
Merge remote-tracking branch 'origin/master' into topic/dnthayer/broctl-fixes
Check bro version and compare to previous install

If the current version of bro doesn't match the version when
broctl install was previously run, then a warning message (to run
broctl install) is displayed when broctl starts.

Addresses BIT-1152
Do not ping when checking if a host is alive

Removed the ping from the host alive check because the ping
might be blocked by a firewall, and neither bro nor broctl needs
the ability to ping hosts.
Adjust broctl status output to avoid bad column alignment

Adjust width of "type" and "host" columns depending on whether we're
running in cluster or standalone mode.