Undertrial prisoner dies in UP