Improve portability of shell scripts used by broctl

Fixed usage of some commands (sed, find, grep, ping) used by broctl to
work across a wider variety of systems.
Fix a deadlock when capturing output from local command

When broctl captures output from a command run locally via the
runLocalCmd method, and if the command generates enough output to fill
the OS pipe buffer, then broctl hangs waiting for the child process
to terminate, which never happens because the child process is waiting
for broctl to read from the pipe.  Fixed by using the "communicate"
method (instead of the "wait" method) of the Python subprocess module.
Fix a race condition when sendmail option is empty string

If the broctl sendmail option is set to an empty string (this
indicates that the user does not want email sent), then when
broctl execs the shell script to send mail it just exits immediately
(as expected) which triggers a race condition on some systems that
terminates broctl because the child process exits before broctl
can send input via the stdin pipe.  Fixed by not executing the shell
script when the sendmail option is an empty string.
Fix the broctl "top" command output on Linux

On Linux, the broctl "top" command output was sometimes showing the
wrong suffix for the memory statistics (example: it would show 70K
when the correct value is 70M), because the Linux top command does
not use any suffix when the value is kilobytes (e.g., 70 megabytes is
sometimes shown as 70000).  The solution is to set "def_factor=1024"
when running the "to-bytes.awk" script, but this would also multiply
the PID and CPU usage numbers, so new options were added to specify
the starting and ending fields to apply the conversion.

Also added filtering of the header output of the FreeBSD top command,
in order to avoid processing by the "to-bytes.awk" script (some lines
in the header start with a number).
Merge remote-tracking branch 'origin/master' into topic/dnthayer/broctl-fixes
Merge remote-tracking branch 'origin/topic/dnthayer/broctl-fixes'

* origin/topic/dnthayer/broctl-fixes:
  Fix the broctl "top" command output on Linux
  Fix a race condition when sendmail option is empty string
  Fix a deadlock when capturing output from local command
  Improve portability of shell scripts used by broctl
Merge branch 'topic/robin/broctl-fixes-merge'

* topic/robin/broctl-fixes-merge:
  Fix the broctl "top" command output on Linux
  Fix a race condition when sendmail option is empty string
  Fix a deadlock when capturing output from local command
  Improve portability of shell scripts used by broctl

BIT-1087 #merged.