A kthread doing set_freezable*() may race with on-going PM freeze and
the freezer might think all tasks are frozen while the new freezable
kthread is merrily proceeding to execute code paths which aren't
supposed to be executing during PM freeze.
This can be fixed by modifying and testing the related PF flags inside
freezer_lock and removing mostly unnecessary early tests from the
callers of freeze/thaw_task().
* Remove all unnecessary tests from kerne/power/process.c and add
PF_NOFREEZE test to freeze_task(), which is meaningful as it avoids
sending unsolicited wakeups to nofreeze tasks.
* Reimplement set_freezable[_with_signal]() using __set_freezable()
such that freezable PF flags are modified under freezer_lock and
try_to_freeze() is called afterwards. Combined with the above
change, this eliminates race condition against freezing.