restart phantomjs server if phantomjs goes into an infinite javascript loop