Only use setRawMode when the function is defined.

In a lot of environments, the setRawMode is not defined which breaks the
grunt flow. This change would fix the problem.