Invariant P-values for Model Checking and Checking for Prior-data Conflict