Replace detection of master/slave process for pytes hooks with a much elegant solution based on pytest instead of synch based on touching a file.