fixes https://github.com/piwik/piwik/pull/5965 Thanks for suggestion @snout1979
Testing if /proc is a resource with @fopen fails on systems with open_basedir set.
 by using stat we not only test the existance of /proc but also confirm it's a 'proc' filesystem