ARC: Fix broken GDB break support

It has been found that typing Ctrl+C command in GDB doesn't halt execution
on target as it should. Same issue was observed on GNU IDE when was trying
to force halt CPU, since essentially it is implemented via issuing SIGINT to
GDB.

The problem has been traced down to the invalid implementation of target
resume procedure in ARC OpenOCD. In our implementation we've been waiting
until the core will be halted due to breakpoint or other internal reason,
which mainly worked as wait_until_core_halted() function mostly slept this
allowed gdb_server to perform it duties, however that also meant that it got
stuck it invalid layer. Function trace was like this:

1. Handle c-packet
2. Resume
3. Wait until core is halted
4. Do regulat gdb_server duties, including receiving new packets.

So at level #4 we were indeed receiving break signal, and setting respective
bit in the internal variable, but the problem is that handling of this
variable and thus actual halt are handled after c-packet will be handled. As
a result, Ctrl+C sequence wouldn't be handled by the OpenOCD until the core
will halt anyway, which might never happen.

To avoid a problem we shouldn't wait for core halt in the resume function.
Instead we should return from it and let OpenOCD to freely poll target until
it will halt. This way OpenOCD will be also allowed to handle break
sequence.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
ARC: Introduce CHECK_RETVAL macro and use it

NDS32 implementation has a nice CHECK_RETVAL macro which auto-checks for
return value of functions and returns if it is an error. This simplifies
code of functions calls, since we don't need to check for return value
explicitly, other than we have to wrap function call in this macro. This
macro doesn't help with function functions which allocate memory since it
returns immediately and allocated memory will not get freed. So in those
functions we have to check for return value manually. At least for now.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
ARC: Do not overwrite DEBUG.UB bit in arc_dbg_enter_debug

Force halt CPU by doing read-modify-write of DEBUG bit, instead of plain
write.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>