kernel: mempool: fix race condition in rt_mp_alloc

When thread wake up from waiting for memory, there is a chance that
there is no memory available in high pressure. So use a loop to check
again. Otherwise, there will be a NULL reference.

Commit b8bf6bef76bdabe76749c752217afbe5d24ba371 from master.
Merge pull request #317 from grissiom/fix-mempool-st

[stable] kernel: mempool: fix race condition in rt_mp_alloc