drivers: modem: Add function to wait for sem and handle error

Add a helper function that waits for a semaphore and handles the
error conditions that may arise.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2 files changed