Try using Output Buffering, send the header, then ob_flush() and flush() (in that order) the header to the browser, then run the command.
EDIT: Also, I'm no Unix expert, but wouldn't that command cause the Apache module to wait for the commands finish (and therefore in the process, be killed before completion) ? What if you added a '&' onto the command, so that it essentialy forks into the background, i.e.
exec("/usr/bin/sudo $cmd &");