Implemented doStep pending status handling
Sometimes, a doStep can return a pending status. Previously, this has not been taken into account in any way. Only errors and fatal return a different status than ok, warning and pending.
We should return a different value for pending status from native code, so that it can properly be handled by the Java side.