Fix Portland compiler warnings

The PGI compiler finds several unreachable code
parts, mainly due to multiple return statements
being used. For most places this is just a
cosmetic fix to get rid of warnings, but functions
that are performance-sensitive should only have
a single return statement since the return
instruction causes a pipeline stall on many
architectures. This patch also fixes a warning
about an unused variable.

Change-Id: Ibf1c9e9dd1cdf29fc59c84afa4348e02bed270e6