Fix FirefoxProfile::encode() so FireFoxProfile works for Windows Users as well

Some minor changes but this seems to have solved the issue that was raised in: https://github.com/facebook/php-webdriver/issues/165#.

There are some further possible improvements that can be made to encode() after extensive debugging of this function but I'll leave those open for another time.