Make sure error code of batch scripts is returned properly. Based on suggestions from Jack Cai (GERONIMO-4525)