YARN-2607. Fixed issues in TestDistributedShell. Contributed by Wangda Tan.