Prevent starvation case on executing local commands

Solves two problems with VMController.execute_local_command
1- trying to read too less characters from the stdout
2- fix the check for testing if the process is finished