This change seems to fix the symptom I get a couple levels up the abstraction chain in Persistent:
finish :: Connection
-> IO ()
finish (Conn fp _) = do
uninterruptibleMask_ $ finalizeForeignPtr fp
yesodweb/persistent#1199
I discovered this fixed that symptom here: yesodweb/persistent#1199 (comment)