Test that runST is not inlined prematurely

This resulted form a discussion about #5916.