Fix some small bugs found by coverity
Fix some small bugs found by coverity

darktable-org/rawspeed,LebedevRI/rawspeed,LebedevRI/rawspeed,darktable-org/rawspeed,darktable-org/rawspeed,LebedevRI/rawspeed,LebedevRI/rawspeed,darktable-org/rawspeed,darktable-org/rawspeed,mgehre/rawspeed,anarsoul/rawspeed,anarsoul/rawspeed,LebedevRI/rawspeed,anarsoul/rawspeed,mgehre/rawspeed,klauspost/rawspeed,klauspost/rawspeed