core: fix semaphore release

Release semaphore if synchronize() fail.

Signed-off-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>