Change uses of `sys.platform == 'linux2' to `sys.platform.startswith('linux')

Although the current method is valid up till python 3.3 (which is not supported)
this seems to be a clearer way of checking for linux and moves the tests towards
python 3 compatibility.