Implement command_timeout setting

Do this by running the child process in a thread, and using
thread.join() with a timeout. Inspired by:

http://stackoverflow.com/questions/1191374/subprocess-with-timeout