Address FindBugs errors (THRIFT-2239)

This commit reduces the number of errors from 41 to 18.