[WFLY-1240]:Fix several issues found by Coverity