Analyzer issues

I fixed some issues pointed out by the static analyzer (and also fixed  some warnings).

The last commit needs some explanation. The issues was that the error code returned from ```CCCryptorCreateWithMode``` was never checked (although it was stored in a variable). I guessed that upon error, we should return nil and free resources. This would require the following to be repeated (or add goto/cleanup code):

```
    free(buffer);
    return nil;
```

To avoid that, I changed buffer to be NSData, so it is subject to ARC and will be cleaned up automatically. So the logic has changed a bit, please check it! Running the tests did not reveil regression, so I beleive it is correct.