IPC: fix a potential race condition at init

It's possible that between the moment the code tries to get the
semaphore it has been destroyed, so let's try in a loop to catch it
until we succeed.

Change-Id: I853a7262ebd94ec954f4fb923e7547c8fd7841b4
Merge "IPC: fix a potential race condition at init"