When checking to see if the service is running, use ps to verify
that the pid file refers to the right command.
Use sed instead of basename since $cmd may include command line
options.
When removing a service, if SMF is present only use svcadm to disable
the service.  Previously we would run the init.d script first and
then call svcadm.
In pp_files_expand() mark _target as a local variable so we
don't inadvertantly inherit a value from a previous call.
Don't try to run installp without sudo unless it is executable by us.